LoginService
final class LoginService
Login policy: verifies credentials and applies the account rules (password-reset, inactive, failed-attempt lockout) as a returned LoginResult, leaving all HTTP behavior to the caller. Replaces the redirect-driven AuthService::login()/loginAttempts() flow.
Methods
Attempts to authenticate the given username. On success the user is logged in via the guard and their failed-attempt counter reset; on failure, attempts are tracked and the account locked past the configured maximum. No redirects or flash messages are issued — the outcome is returned for the caller to act on.
Tracks a failed login attempt: locks the account once the configured maximum is reached, optionally emails on the transition into the locked state, records the appropriate failure message, and increments the attempt counter. Ports AuthService::loginAttempts() verbatim, returning a LoginResult in place of the Login model.
Details
at line 34
static LoginResult
attempt(Input $request, Login $loginModel, string $username, bool $mailer = false)
Attempts to authenticate the given username. On success the user is logged in via the guard and their failed-attempt counter reset; on failure, attempts are tracked and the account locked past the configured maximum. No redirects or flash messages are issued — the outcome is returned for the caller to act on.
at line 86
static private LoginResult
registerFailedAttempt(Users $user, Login $loginModel, bool $mailer = false)
Tracks a failed login attempt: locks the account once the configured maximum is reached, optionally emails on the transition into the locked state, records the appropriate failure message, and increments the attempt counter. Ports AuthService::loginAttempts() verbatim, returning a LoginResult in place of the Login model.