grosv / laravel-passwordless-login

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

Error when user is already authenticated but RouteServiceProvider::HOME is not defined #84

Closed joe-pritchard closed 2 years ago

joe-pritchard commented 2 years ago

An error is thrown by HandleAuthenticatedUsers.php if RouteServiceProvider::HOME is not defined. In my application I use the alternative home() method instead.

I've fixed it and opened a PR if it helps :) - https://github.com/grosv/laravel-passwordless-login/pull/83

My PR checks for the existence of the home() method, and falls back to the constant if it's not defined, and if the constant is not defined either only then does it fall back to using the config value. It also handles the case where the programmer has changed their app namespace.

Everything else should work the same as it does now.

edgrosvenor commented 2 years ago

@joe-pritchard Thank you! I appreciate the PR. I was made aware of the issue earlier in the week, but my household is in the middle of a covid outbreak so I haven't had a chance to dig in.

joe-pritchard commented 2 years ago

You're welcome :) Hope you're you're all doing okay, wishing you speedy recoveries!