providers/email library

This library contains the email authentication provider for the Serverpod IDP module.

Classes

AuthEmail
The default implementation for the email account endpoint methods.
AuthEmailBaseEndpoint
Base endpoint for email-based accounts.
AuthSuccess
EmailAccount
A fully configured email account to be used for logins.
EmailAccountConfig
Configuration options for the email account module.
EmailAccountFailedLoginAttempt
Database table for tracking failed email sign-ins. Saves IP-address, time, and email to be prevent brute force attacks.
EmailAccountPasswordResetAttempt
Database table for tracking password reset attempts. A new entry will be created whenever the user tries to complete the password reset.
EmailAccountPasswordResetRequest
EmailAccountPasswordResetRequestAttempt
Database table for tracking password reset requests attempts.
EmailAccountRequest
Pending email account registration.
EmailAccountRequestCompletionAttempt
Database table for tracking email account completion requests. A new entry will be created whenever the user tries to complete the email account setup.
EmailAccounts
Email account management functions.
EmailAccountsAdmin
Administrative email account management functions.

Enums

EmailAccountLoginFailureReason
The reason for why the authentication via email credentials was rejected.
EmailAccountRequestResult
The result of the EmailAccounts.completeAccountCreation operation.
PasswordResetResult
Describes the result of a password reset operation.

Typedefs

PasswordValidationFunction = bool Function(String password)
Function to be called to check whether a password matches the requirements during registration.
RateLimit = ({int maxAttempts, Duration timeframe})
A rolling rate limit which allows maxAttempts in the most recent timeframe.
SendPasswordResetVerificationCodeFunction = void Function(Session session, {required String email, required UuidValue passwordResetRequestId, required Transaction transaction, required String verificationCode})
Function for sending out the verification codes for password reset requests.
SendRegistrationVerificationCodeFunction = void Function(Session session, {required UuidValue accountRequestId, required String email, required Transaction transaction, required String verificationCode})
Function for sending out the verification codes to verify the email ownership during the initial registration.

Exceptions / Errors

EmailAccountLoginException
Exception to be thrown if the login via email/password fails.
EmailAccountNotFoundException
Exception thrown for operations trying to operate on an email address for which no account exists.
EmailAccountPasswordPolicyViolationException
Exception to be thrown when a attempting to set a password which does not match the configured policy.
EmailAccountPasswordResetRequestExpiredException
Exception to be thrown when the password reset request was used after it has expired.
EmailAccountPasswordResetRequestNotFoundException
Exception to be thrown when a password reset request could not be found.
EmailAccountPasswordResetRequestTooManyAttemptsException
Exception to be thrown when too many attempts were made to request a password reset.
EmailAccountPasswordResetRequestUnauthorizedException
Exception to be thrown when an attempt was made to complete a password reset with an invalid verification code.
EmailAccountPasswordResetTooManyAttemptsException
Exception to be thrown when too many attempts were made on a single password reset request.
EmailAccountRequestExpiredException
Exception to be thrown when one attempts to complete an email account request after it has expired.
EmailAccountRequestNotFoundException
Exception to be thrown when an email account request could not be found by the given id.
EmailAccountRequestNotVerifiedException
Exception to be thrown when an attempt is made to complete the creation of an email account before the account request has been verified.
EmailAccountRequestTooManyAttemptsException
Exception to be thrown when too many verification attempts were made on a email account request.
EmailAccountRequestUnauthorizedException
Exception to be thrown when the verification code given for an email account request is not valid.