[bug] Remember Session is not working if user does not have a password
octoper opened this issue · comments
Describe the bug
When I'm trying to login (let's say with GitHub) if I have the rememberSession
feature enabled and the user does not have a password, the remember session functionality is not working.
I have seen that Laravel Jetstream adds a middleware /jetstream/src/Http/Middleware/AuthenticateSession.php
, this middleware extends this one Illuminate\Session\Middleware\AuthenticateSession
and in the handle method when remember session is requested, it tries to get the user password so it can create a hash and store it in the session, but if it can't find the password it can't create the has and logs the user out immediately.
To Reproduce
Steps to reproduce the behavior:
- Setup any provider you want
- Go to
config/socialstream.php
- Enable the rememberSession feature
- Use database session driver
SESSION_DRIVER=database
- Try to login with the provider you had setup at the beginning
- You will see that it's not logging the user in but it just logging him out.
Expected behavior
The expected behavior is that when the remember session feature is enable the user stays logged until he destroys the session (e.g by logout).
Environment context
- Socialstream version: 3.7.3
- Jetstream stack: Inertia
- Laravel version: 9.24.0
- PHP version: 8.1.5
Hi, thanks for reporting this - what browser are you experiencing this issue with?
I have just pulled the latest release (v3.7.4) and set up the GitHub provider locally and I've:
- Opened Google Chrome
- Navigated one to the
/register
route and registered for the first time with GitHub - Logged out using the
Log Out
option in Jetstream's dropdown menu - Navigated to the
/login
route - Logged in with GitHub from the login screen
- Closed the tab and navigated back to the app – still logged in
- Quit my browser, opened it again and navigated back to the app – still logged in
- Opened Safari
- Navigated to
/login
- Logged in with GitHub
- Quite Safari, re-opened it and navigated to the app locally – still logged in.
Please can you provide any additional steps that you may be taking that I have missed in the above? If possible, please can you provide a screencast of the problem occurring locally and (optionally) on a public server? Thanks!
Closing this due to inactivity. Please "@" me if you feel this is still an issue with the package.