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

Clear session on impersonation exception #193

Open erikn69 opened 4 months ago

erikn69 commented 4 months ago

When quietLogout doesn't exists, take returns false, but session keeps impersonated_by, this causes the app to behave as if it is being impersonated to another user when in reality that is not the case When quietLogin doesn't exists, take returns false but current user already be logout, and no user is logged in https://github.com/404labfr/laravel-impersonate/blob/d8ab69f05daab4117b313e11ca007fbf3199a1ab/src/Services/ImpersonateManager.php#L116-L125 https://github.com/404labfr/laravel-impersonate/blob/d8ab69f05daab4117b313e11ca007fbf3199a1ab/src/Services/ImpersonateManager.php#L65-L68