Vue can't find a rout in laravel when I put it in middleware.



  • I have separate annexes
    1.Vue
    2.Laravel
    In the case of the Vue authorisation in Laravel, use laravel sanctum and attempting to protect the routes available only to authenticated users decided to blend /logout in middleware and, as a result of Vue, the route was stopped to return 500. If I remove this route from the middleware, then I see it again. middleware

    There's also a /user route, and he works very well in this middleware, and he also feels fine outside.
    Can you tell me what this behavior might cause?



  • Anyway, in my case, I...

    1. I went into the sanctum.php and added the guard to the state "web"
    2. I went into my UserController, where I made logout and wrote
    Auth::guard('web')->logout();
    

    Before that,

    Auth::logout()
    

    And I got a mistake askingGuard:
    Note: I'm drawing attention to the logout that I've got red as if it's a mistake, don't pay attention to it, he'll work. Auth::guard('web')->logout()



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2