404labfr / laravel-impersonate

Laravel Impersonate is a plugin that allows you to authenticate as your users.
https://marceau.casals.fr
1.95k stars 203 forks source link

Using Passport API not working returing false everytime #199

Open pankajsondagar opened 3 months ago

pankajsondagar commented 3 months ago

$customer = User::find($request->userId);

$data = Auth::user()->impersonate($customer);

Is there any way to make it working in API's?

jose123v commented 2 months ago

Maybe https://github.com/404labfr/laravel-impersonate/issues/183#issuecomment-2090775228

TokenGuard is Macroable laravel/passport/Guards/TokenGuard.php#L28-L30