grosv / laravel-passwordless-login

A simple, safe magic login link generator for Laravel
841 stars 60 forks source link

REMEBER_LOGIN issue following upgrade to 1.7.0 #78

Closed rdevonshire closed 2 years ago

rdevonshire commented 2 years ago

Hi there,

Firstly, thank you for developing such a great package!

Following the upgrade to 1.7.0, the behaviour of REMEMBER_LOGIN seems to have changed.

We use this package as a form of basic SSO, a URL is generated with a short TTL with USE_ONCE set to true and REMEMBER_LOGIN set to false. Previously this would allow us to login as any User, regardless if we had an existing session or not.

Now, we have to logout of the app before being able to use another passwordless login URL as we're simply redirected back to home, as if REMEMBER_LOGIN is set to true.

I thought this may have been the same issue as #76 but updating 1.7.1 has now introduced an exception when trying to login using a URL when already logged in:

Undefined constant App\Providers\RouteServiceProvider::HOME {"userId":99,"exception":"[object] (Error(code: 0): Undefined constant App\\Providers\\RouteServiceProvider::HOME at /home/user/app/vendor/grosv/laravel-passwordless-login/src/HandleAuthenticatedUsers.php:17)

Logging out of the app allows us to login again using a new URL but otherwise the above exception is thrown.

We're using Laravel 7 at the moment.

Apologies if this report is lacking information, let me know if there's anything further you need.

Thank you again!

rdevonshire commented 2 years ago

Just to confirm, downgrading to 1.6.0 resolves this issue

edgrosvenor commented 2 years ago

@rdevonshire I just did a release that I think should solve this.