Files
fotospiel-app/app/Filament/Pages/Auth/Login.php
Codex Agent 64a5411fb9 - Reworked the tenant admin login page
- Updated the User model to implement Filament’s tenancy contracts
- Seeded a ready-to-use demo tenant (user, tenant, active package, purchase)
- Introduced a branded, translated 403 error page to replace the generic forbidden message for unauthorised admin hits
- Removed the public “Register” links from the marketing header
- hardened join event logic and improved error handling in the guest pwa.
2025-10-13 12:50:46 +02:00

62 lines
1.5 KiB
PHP

<?php
namespace App\Filament\Pages\Auth;
use Filament\Auth\Pages\Login as BaseLogin;
use Filament\Schemas\Components\Component;
class Login extends BaseLogin
{
public function getTitle(): string
{
return __('auth.login.title') ?: parent::getTitle();
}
public function getHeading(): string
{
return __('auth.login.title') ?: parent::getHeading();
}
protected function getEmailFormComponent(): Component
{
$component = parent::getEmailFormComponent();
return $component
->label(__('auth.login.username_or_email') ?: $component->getLabel());
}
protected function getPasswordFormComponent(): Component
{
$component = parent::getPasswordFormComponent();
return $component
->label(__('auth.login.password') ?: $component->getLabel());
}
protected function getRememberFormComponent(): Component
{
$component = parent::getRememberFormComponent();
return $component
->label(__('auth.login.remember_me') ?: $component->getLabel());
}
protected function getCredentialsFromFormData(array $data): array
{
$identifier = $data['email'] ?? '';
$password = $data['password'] ?? '';
if (filter_var($identifier, FILTER_VALIDATE_EMAIL)) {
return [
'email' => $identifier,
'password' => $password,
];
}
return [
'username' => $identifier,
'password' => $password,
];
}
}