Skip to content

withoutAuthenticationRoutes with default login: /login creates redirect loop #6786

@m-lotze

Description

@m-lotze
  • Laravel Version: 12.3.0
  • Nova Version: 5.4.1

Description:

Not sure when this was introduced, but in our app a default custom /login route now creates a redirect loop. We had to rename the route.

In 5.3.1 we had this route registration in NovaServiceProvider and it worked with a custom /login route:

protected function routes(): void
{
    Nova::routes()
        ->withPasswordResetRoutes()
        ->register();
}

After upgrading to 5.4.1 it needs to be this:

protected function routes(): void
{
    Nova::routes()
        ->withoutAuthenticationRoutes(Login: '/custom-login')
        ->withPasswordResetRoutes()
        ->register();
}

Using /login instead of /custom-login creates a redirect loop, because of line 244 in PendingRouteRegistration.php:

$router->redirect('/login', $this->loginPath)->name('nova.pages.login');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions