joelbutcher / socialstream

OAuth for Laravel, simplified.

Home Page:https://docs.socialstream.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[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:

  1. Setup any provider you want
  2. Go to config/socialstream.php
  3. Enable the rememberSession feature
  4. Use database session driver SESSION_DRIVER=database
  5. Try to login with the provider you had setup at the beginning
  6. 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:

  1. Opened Google Chrome
  2. Navigated one to the /register route and registered for the first time with GitHub
  3. Logged out using the Log Out option in Jetstream's dropdown menu
  4. Navigated to the /login route
  5. Logged in with GitHub from the login screen
  6. Closed the tab and navigated back to the app – still logged in
  7. Quit my browser, opened it again and navigated back to the app – still logged in
  8. Opened Safari
  9. Navigated to /login
  10. Logged in with GitHub
  11. 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.