Using Custom Login Route for all Panels

I'm working on a Filament app and would like to use mutiple panels. After creating my panels, I discovered that each panel has it's own login page. I'm wondering if it's possible to have the same login page for all panels. For example, instead of admin\login app\login customer\login I want one login for all domain.com\login Does anyone has an idea on how to go about this?
11 Replies
Saifallak
Saifallak16mo ago
you can allow one login for defualt panel only, then use panel swithcer by bezhan to switch between panels assuming that all panels uses same guard
stanwarri
stanwarriOP16mo ago
Thanks for your input. However, how do you manage automatically redirecting users to their panel (dashboard) based on their usertype?
Saifallak
Saifallak16mo ago
use custom login page then and then restrtict access to other panels by using canAccessPanel all that is just suggestion, i didn't test them, just according to docs and some ideas, so if it works tell me ^^
stanwarri
stanwarriOP16mo ago
I have tried the custom login page by first defining a login route Route::get('/login', \App\Filament\Pages\Auth\Login::class)->name('login') I extended the default Auth page
<?php

namespace App\Filament\Pages\Auth;

use Filament\Pages\Auth\Login as BasePage;

class Login extends BasePage
{
public function mount(): void
{
parent::mount();
}
}
<?php

namespace App\Filament\Pages\Auth;

use Filament\Pages\Auth\Login as BasePage;

class Login extends BasePage
{
public function mount(): void
{
parent::mount();
}
}
Without adding any logic to it yet, and just trying things out, I'm getting this error Unable to find component: [app.filament.pages.auth.login] This happens whenever, I submit the login form
toeknee
toeknee16mo ago
That happens because app.filament.pages.auth.login view doesn't exist.
Saifallak
Saifallak16mo ago
i meant to override the login in panel provider ->login(CLASS) @stanwarri
stanwarri
stanwarriOP16mo ago
Oh yes, I did that already with my new custom class. I forgot to mention that So I was assume that shouldn't be an error since I was only extending the default Auth class
toeknee
toeknee16mo ago
You are but that view isn't exisitng in the calling place.
stanwarri
stanwarriOP16mo ago
But the original class already has it's view page defined protected static string $view = 'filament-panels::pages.auth.login'; and it's showing the login page for me. This error only happens when I try to submit the login What would you have done differently?
Wbzy
Wbzy11mo ago
@stanwarri did you find any solution?
stanwarri
stanwarriOP11mo ago
No, I haven't been able to find a solution to this. What have you tried?
Want results from more Discord servers?
Add your server