-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authentication does not persist when session.driver == 'database' #158
Comments
@vomitHatSteve - Appreciate the detailed report here, Steve. I'm not entirely sure what's happening here but would hope anything session related would have been fixed in 5.3.x. That said, some of this might come from callback handling that could be improved (see #141). I would look into that callback route and see if you can figure out what's causing a successful login to redirect or what error you're getting back from Auth0. I'll leave this open in the meantime to hopefully help with troubleshooting. |
Great! Thank you. |
Hi @joshcanhelp , @lbalmaceda as part of a ticket I was able to reproduce the same issue with the reference sample. Let me know if I can help with anything. PS: For this issue I haven't opened an engineering task. |
I am having this same issue. Has anyone managed to get this working? |
@vomitHatSteve @marlboro - Would you be able to give the https://github.com/auth0/laravel-auth0/tree/change-user-model We've changed a lot around how the session is handled both in the SDK and this library. |
I will test as soon as I get a chance. My company has added a whole stack of other priorities in the meantime, so it may be a bit. |
Ok. Found some time. In a first test, it still had the infinite redirect. However, I'm not sure if my dependencies are correct. edit: tried a few alternate methodologies for installing the libraries, and the issue is definitely still occurring
|
Hi all, sorry going to piggyback on this ticket as I have the same issue described here. Few things whilst debugging I discovered: my
The issue may be the fact the |
Further to this: In my
If I try to call the authenticated user in the |
@vomitHatSteve I don't know what your setup is however, I have managed to find a solution to my continual looping. I've changed my
This now manages to find the user successfully and set it to the property in the class. My loops have not stopped and I can re-use this middleware fix to load the auth user in any of my controllers. Hope this helps 👍 |
@caleuanhopkins - Big time thank you for the troubleshooting steps here! Is there anything we can do better in this library or documentation to help avoid this in the future? |
@saltukalakus - Are you able to confirm the fix here? |
@joshcanhelp I think documentation wise the middleware closure I shared above should be highlighted otherwise Laravel Devs will get the continuous loop happening. I actually think this is more a Laravel execution ordering issue rather than Auth0. Other than that, I can't think of anything. We're actually running this library in production on an auto-scaling microservice platform and haven't had any issues since we discover the fix I shared above. If we find anything I'll be in touch 👍 |
Just an update on this. We ran into a similar issue. Because of the default migration (from the docs https://laravel.com/docs/7.x/session) |
Thank you @christian-at-7lab for posting your fix. It worked for me too. This should be mentioned somewhere in the installation tutorial. |
Description
If the session driver is set to database, successful authentication is forgotten, creating an infinite redirection loop.
Reproduction
Upon signing into Auth0, the browser is thrown into an infinite redirect loop
Environment
Other notes
This issue has been noticed before in the auth0-samples repositories (auth0-samples/laravel#10) but was ultimately not resolved.
The text was updated successfully, but these errors were encountered: