MemberAuthenticationService
in package
uses
LocatorAwareTrait
Handles authentication-related business logic for members.
Covers login error categorization, forgot-password token generation, password-reset token validation, and post-login redirect resolution. Controller-layer concerns (request parsing, flash, redirect responses) remain in MembersController.
Table of Contents
Properties
Methods
- __construct() : mixed
- categorizeLoginError() : string
- Categorize an authentication failure into a user-facing error message.
- generatePasswordResetToken() : array{found: bool, email?: string, resetUrl?: string, secretaryEmail?: string}
- Look up a member by email and generate a password-reset token.
- resetPassword() : bool
- Apply a new password and clear the reset token.
- validateResetToken() : ResetPasswordForm}
- Validate a password-reset token and return the member if valid.
Properties
$Members
private
MembersTable
$Members
Methods
__construct()
public
__construct() : mixed
categorizeLoginError()
Categorize an authentication failure into a user-facing error message.
public
categorizeLoginError(Result $result) : string
Parameters
- $result : Result
-
Failed authentication result.
Return values
string —Translated error message for the user.
generatePasswordResetToken()
Look up a member by email and generate a password-reset token.
public
generatePasswordResetToken(string $emailAddress) : array{found: bool, email?: string, resetUrl?: string, secretaryEmail?: string}
Parameters
- $emailAddress : string
-
Email address submitted by the user.
Return values
array{found: bool, email?: string, resetUrl?: string, secretaryEmail?: string}resetPassword()
Apply a new password and clear the reset token.
public
resetPassword(Member $member, string $newPassword) : bool
Parameters
- $member : Member
-
Member resetting their password.
- $newPassword : string
-
New password value.
Return values
bool —True when save succeeds.
validateResetToken()
Validate a password-reset token and return the member if valid.
public
validateResetToken(string|null $token) : ResetPasswordForm}
Parameters
- $token : string|null
-
Password reset token from URL.