feat(auth): separate landlord and tenant login experience based on domain
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Successful in 47s
Koori-ERP-Deploy-System / deploy-production (push) Has been skipped

This commit is contained in:
2026-01-15 13:56:11 +08:00
parent 9ce8ff4e06
commit 287ac6faa3
3 changed files with 118 additions and 0 deletions

View File

@@ -15,6 +15,12 @@ class LoginController extends Controller
*/
public function show()
{
$centralDomains = config('tenancy.central_domains', []);
if (in_array(request()->getHost(), $centralDomains)) {
return Inertia::render('Landlord/Auth/Login');
}
return Inertia::render('Auth/Login');
}
@@ -36,6 +42,11 @@ class LoginController extends Controller
if (Auth::attempt($credentials, $request->boolean('remember'))) {
$request->session()->regenerate();
$centralDomains = config('tenancy.central_domains', []);
if (in_array($request->getHost(), $centralDomains)) {
return redirect()->intended(route('landlord.dashboard'));
}
return redirect()->intended(route('dashboard'));
}