Sep 18, 2018
0
Level 1
Laravel API / Passport - Change auth user
I use Laravel 5.7 with Passport and Vue component.
I have a Vue component with method to change Auth of user, this method call API by POST.
My API is protected by auth:api middleware.
The connexion to site is with PHP session. I don't want use JWT.
How I can change the account connected ?
public function switchAccount(Request $request, Team $team, User $user)
{
Auth::guard('web')->login($user);
}
Please or to participate in this conversation.