How to fix login redirect loop

It is hard to reproduce. This is why I think this similar discussion has no answer This is the second time it is happening on my local machine in space of about 3 weeks. Clearing site cookies gets the login url /customer-backend/login to display. On login, the screnshot happens. When I clear site cookies again, login page displays and enters the loop again on submit...until clear cookies again and cycle continues. Maybe some Laravel thing I'm missing out?
GitHub
Login redirects to it self after successful login - in laravel 9.x ...
i have just installed a fresh laravel project and installed filament package, there are no console errors and authentication is working fine, but after a successful login the page just redirects to...
No description
Solution:
GitHub
Login redirects to it self after successful login - in laravel 9.x ...
i have just installed a fresh laravel project and installed filament package, there are no console errors and authentication is working fine, but after a successful login the page just redirects to...
Jump to solution
2 Replies
damms005
damms005OP10mo ago
This is the panel service provider (relevant code only)
<?php

namespace App\Providers\Filament;

class CustomerBackendPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->id('customer-backend')
->path('customer-backend')
->registration(Register::class)
->emailVerification()
->login()
->profile()
->passwordReset()
->colors([
'primary' => Color::Green,
])
->navigationGroups([...])
->discoverResources(in: app_path('Filament/CustomerBackend/Resources'), for: 'App\\Filament\\CustomerBackend\\Resources')
->discoverPages(in: app_path('Filament/CustomerBackend/Pages'), for: 'App\\Filament\\CustomerBackend\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/CustomerBackend/Widgets'), for: 'App\\Filament\\CustomerBackend\\Widgets')
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
])
->tenant(Customer::class, slugAttribute: 'slug')
->tenantMiddleware([
ConfirmActiveSubscription::class,
], isPersistent: true)
->spa();
}
}
<?php

namespace App\Providers\Filament;

class CustomerBackendPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->id('customer-backend')
->path('customer-backend')
->registration(Register::class)
->emailVerification()
->login()
->profile()
->passwordReset()
->colors([
'primary' => Color::Green,
])
->navigationGroups([...])
->discoverResources(in: app_path('Filament/CustomerBackend/Resources'), for: 'App\\Filament\\CustomerBackend\\Resources')
->discoverPages(in: app_path('Filament/CustomerBackend/Pages'), for: 'App\\Filament\\CustomerBackend\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/CustomerBackend/Widgets'), for: 'App\\Filament\\CustomerBackend\\Widgets')
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
])
->tenant(Customer::class, slugAttribute: 'slug')
->tenantMiddleware([
ConfirmActiveSubscription::class,
], isPersistent: true)
->spa();
}
}
It does not help running optimize:clear
Solution
damms005
damms00510mo ago
GitHub
Login redirects to it self after successful login - in laravel 9.x ...
i have just installed a fresh laravel project and installed filament package, there are no console errors and authentication is working fine, but after a successful login the page just redirects to...
Want results from more Discord servers?
Add your server