PasswordResetService
class PasswordResetService (View source)
Methods
__construct(DbPasswordResetTokenRepository $tokenRepository, UserRepository $userRepository, MailService $mailService, ConfigurationInterface $config, UserAuthenticationService $authService, IpAddressRetriever $ipRetriever, LoggerInterface $logger)
No description
bool
isEnabled()
Check if password reset is enabled
array
canUserResetPassword(string $email)
Check if a user's authentication method allows password reset
bool
createResetRequest(string $email)
Create a password reset request
array|null
validateToken(string $token)
Validate a password reset token
bool
resetPassword(string $token, string $newPassword)
Reset password using a valid token
void
cleanupExpiredTokens()
Clean up expired tokens
Details
__construct(DbPasswordResetTokenRepository $tokenRepository, UserRepository $userRepository, MailService $mailService, ConfigurationInterface $config, UserAuthenticationService $authService, IpAddressRetriever $ipRetriever, LoggerInterface $logger)
No description
bool
isEnabled()
Check if password reset is enabled
array
canUserResetPassword(string $email)
Check if a user's authentication method allows password reset
bool
createResetRequest(string $email)
Create a password reset request
array|null
validateToken(string $token)
Validate a password reset token
bool
resetPassword(string $token, string $newPassword)
Reset password using a valid token
void
cleanupExpiredTokens()
Clean up expired tokens
This method can be called from anywhere to clean up expired tokens. It's automatically called during:
- Creating new password reset requests
- Validating tokens
- Successful password resets