Impersonate user function - session password_hash not being picked up in middleware #543
-
Hi, I have written a simple function that allows me to impersonate another user:
This does log me in as the user if I add However on redirection I am logged out. It looks like the AuthenticateSession middleware is not picking up the new password hash on this line:
I have been trying to find a fix for this but can't. Can someone tell me why |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@sammyblackbaron hi, i follow vendor/backpack/crud/src/app/Library/Auth/AuthenticatesUsers.php process and get realized thats is make a call to session()->regenerate() after make a new session parameters, as i understanding is needed to refresh saved information, can you try this please. Cheers. |
Beta Was this translation helpful? Give feedback.
Thanks for the reply, it made me review some more of my code and I realised that I had this in my config.backpack.base:
When I changed it to this, my code started to work:
I can't remember adding Middleware\AuthenticateSession and it looks like it isn't needed -…