Created
June 2, 2021 01:01
-
-
Save dmandrade/f8d7e16d32a18e250f933e9ca4705b71 to your computer and use it in GitHub Desktop.
Add password hash in session to fix leave impersonate in Jetstream/Fortify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add password hash in session to fix leave impersonate in Laravel 8 with jetstream | |
@package lab404/laravel-impersonate | |
--- src/Guard/SessionGuard.php | |
+++ src/Guard/SessionGuard.php | |
@@ -16,7 +16,9 @@ class SessionGuard extends BaseSessionGuard | |
public function quietLogin(Authenticatable $user) | |
{ | |
$this->updateSession($user->getAuthIdentifier()); | |
- | |
+ $this->session->put([ | |
+ 'password_hash_' . $this->name => $user->getAuthPassword() | |
+ ]); | |
$this->setUser($user); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To apply it automatically just install the vaimo/composer-patches package.
Save this gist file in PROJECT_ROOT/patches folder.
In composer.json add:
After adding the patch file and update composer.json run composer patch:apply