Emails class

Collection of utility methods when working with email authentication.




hashCode int
The hash code for this object.
runtimeType Type
A representation of the runtime type of the object.


noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
toString() String
A string representation of this object.


operator ==(Object other) bool
The equality operator.

Static Methods

changePassword(Session session, int userId, String oldPassword, String newPassword) Future<bool>
Updates the password of a user.
createAccountRequest(Session session, String userName, String email, String password) Future<bool>
Creates a request for creating an account associated with the specified email address. An email with a validation code will be sent.
createUser(Session session, String userName, String email, String? password, [String? hash]) Future<UserInfo?>
Creates a new user. Either password or hash needs to be provided.
findAccountRequest(Session session, String email) Future<EmailCreateAccountRequest?>
Returns an EmailCreateAccountRequest if one exists for the provided email, null otherwise.
generatePasswordHash(String password, String email) String
Generates a password hash from a users password and email. This value can safely be stored in the database without the risk of exposing passwords.
initiatePasswordReset(Session session, String email) Future<bool>
Initiates the password reset procedure. Will send an email to the provided address with a reset code.
resetPassword(Session session, String verificationCode, String password) Future<bool>
Resets a users password using a password reset verification code.
verifyEmailPasswordReset(Session session, String verificationCode) Future<EmailPasswordReset?>
Verifies a password reset code, returns a EmailPasswordReset object if successful, null otherwise.