[Vuejs]-How to do Laravel authentication for API when using mongodb?

-1👍

Not sure but I think you are not using right auth guard driver in this way the guard should be token please check your auth.php file on config folder and set like below on guards array

   'api' => [
        'driver' => 'token',
        'provider' => 'users',
    ]

Check and set auth for this guard with Auth::guard('api')->user() andAuth::guard('api')->login($user)

Leave a comment