accessEnded = request()->query('access') === 'ended'; } public function login(CheckLoginAllowed $checkLoginAllowed): void { $this->email = trim($this->email); $this->validate( ['email' => ['required', 'string', 'email'], 'password' => ['required', 'string']], [ 'email.required' => __('auth.email_required'), 'email.email' => __('auth.email_invalid'), 'password.required' => __('auth.password_required'), ], ); $email = Str::lower(trim($this->email)); $throttleKey = Str::transliterate($email.'|'.request()->ip()); if (RateLimiter::tooManyAttempts($throttleKey, self::MAX_ATTEMPTS_PER_MINUTE)) { throw ValidationException::withMessages([ 'email' => __('auth.throttle', ['seconds' => RateLimiter::availableIn($throttleKey)]), ]); } $signedIn = Auth::attemptWhen( ['email' => $email, 'password' => $this->password], fn ($user): bool => $checkLoginAllowed->execute($user->getAuthIdentifier()), $this->remember, ); if (! $signedIn) { RateLimiter::hit($throttleKey); $this->reset('password'); // One message for a wrong password and a disabled account, so the // form never confirms that a disabled account's password is right. throw ValidationException::withMessages(['email' => __('auth.failed')]); } RateLimiter::clear($throttleKey); session()->regenerate(); $this->redirectIntended(route('home')); } public function render(): mixed { return $this->view()->title(__('auth.login_title')); } }; ?>
{{ __('auth.login_title') }} @if ($accessEnded) {{-- Not variant="warning": its yellow heading is only 2.8:1 on the light background. --}} @elseif (session('status')) @endif
{{ __('auth.login') }} {{ __('auth.forgot_password') }}