Laravel 10 Upgrade - Login on Nova is causing a redirect loop #5672
Replies: 21 comments 16 replies
-
Unable to reproduce the issue and we don't have enough information to replicate this Please provide full reproducing repository based on fresh installation as suggested in the bug report template (or you can refer to https://github.com/nova-issues for example) |
Beta Was this translation helpful? Give feedback.
-
Hi, Also experiencing redirect loops when accessing /nova then it redirects to nova/login repeatedly Everything worked fine but I needed to remove some packages: "laravel/framework": "^8.0", Thanks |
Beta Was this translation helpful? Give feedback.
-
@thond1st can you elaborate on that? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi @tiagoraposeiraff , |
Beta Was this translation helpful? Give feedback.
-
@thond1st thanks for the info |
Beta Was this translation helpful? Give feedback.
-
thanks @thond1st ! I'm having trouble figuring out why the auth check fails, since the login was successful and there's no visible error on any of the logs |
Beta Was this translation helpful? Give feedback.
-
I've faced same problem before and it was because of CloudFlare's rocket loader, I've disabled that and it fixed. |
Beta Was this translation helpful? Give feedback.
-
Hello @tiagoraposeiraff, Did you solve this? I've tried uninstalling third-party packages and also checked the middlewares in nova.php:
I'am still struggling with the redirect loop unfortunately... |
Beta Was this translation helpful? Give feedback.
-
@FaridAghili thanks for the input, but we don't use Cloudflare, so it can't be it. @alekbless no, we had to put this on hold for a while but before that we still had the same issue, no luck... |
Beta Was this translation helpful? Give feedback.
-
Hello
Replace this ☝️ by this 👇
You can also check upgrade docs more information as I'm having other issues after logging in 😅 Hope that help. |
Beta Was this translation helpful? Give feedback.
-
thanks for the suggestion @ADdora but my |
Beta Was this translation helpful? Give feedback.
-
"Hi there! It seems like you're encountering a tricky issue with the Nova login after upgrading Laravel. While this might not be directly related to your problem, sometimes changes in Laravel versions can affect the behavior of authentication middleware. One thing to check might be the changes in session handling or authentication middleware in Laravel v10.13.5 compared to v9.52.6. Sometimes, such upgrades require adjustments to your application's configuration, especially if there have been changes to the default authentication configuration or session handling. Additionally, if you've made any customizations to the authentication flow in your application, those might need to be reviewed and adapted for the new version. Lastly, it's worth considering if any changes in your application's environment or lifestyle (e.g., server configurations, session handling, or third-party packages) could be influencing this behavior. I hope this helps in troubleshooting the issue. If you have any more details or specific error messages, please share them, and the community might be able to provide more targeted assistance. Good luck with resolving the problem! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
It is indeed related to the Laravel\Nova\Http\Middleware\Authenticate middleware as if I remove this from api_middleware:
I'am able to browse but now the routes is open to unauthenticated users |
Beta Was this translation helpful? Give feedback.
-
Hello good morning. I had a redirection problem when a user is not logged in. The solution for me was to add the login path to the nova configuration file.
|
Beta Was this translation helpful? Give feedback.
-
hello everyone, +exception: ArgumentCountError |
Beta Was this translation helpful? Give feedback.
-
quick update: i hope this can help |
Beta Was this translation helpful? Give feedback.
-
i have same issue. are there any updates? i use a "multi-tenant" structure. it works in the main domain but not in the tenant's domain. |
Beta Was this translation helpful? Give feedback.
-
I have the same issue, also using multi-tenancy
@tiagoraposeiraff Hi, did you find any solution to your problem? |
Beta Was this translation helpful? Give feedback.
-
I tried to compare Kernel.php from my Laravel and the new Laravel 10 installation. The Removed this from app/Http/Kernel.php
|
Beta Was this translation helpful? Give feedback.
-
I stumbled upon this thread troubleshooting the same issue. In my case I have a fresh install of L10 but I'm using a custom JWT auth guard by default. For Nova, I have it set to I noticed if I dumped out the Config for nova,
Even after removing the env() wrapper and hard-coding a value it was always null. I did config:clear and all that in between changes. What ended up fixing it was manually adding the value to .env:
Looking through the Nova code, the Authenticate middleware is definitely checking for it: Anyway, maybe this will help out someone with the same issue. |
Beta Was this translation helpful? Give feedback.
-
Description:
After upgrading the Laravel version from v9.52.6 to v10.13.5 the Nova login stopped working.
It keeps returning a 302 status causing a
Too Many Redirects Issue
.It goes from
/nova
to/nova/login
, back and forth.I was able to determine via var_dump that when reaching the
LoginController::authenticated()
method the user is there and it's valid.But when it reaches the
Authenticate::authenticate()
middleware method and tries to perform the auth check, it always returns false, on ln 63:if ($this->auth->guard($guard)->check())
I also confirmed that the
$guard
variable is correct (web
).I search the web for similar issues and I couldn't find any, which led me to asking for some help here with this (possible) bug.
Beta Was this translation helpful? Give feedback.
All reactions