Account Management

class flaskbb.core.auth.password.ResetPasswordService[source]

Interface for managing the password reset experience in FlaskBB.

initiate_password_reset(email)[source]

This method is abstract.

Used to send a password reset token to a user.

This method may raise a ValidationError when generating the token, such as when the user requests a reset token be sent to an email that isn’t registered in the application.

Parameters:email (str) – The email to send the reset request to.
reset_password(token, email, new_password)[source]

This method is abstract.

Used to process a password reset token and handle resetting the user’s password to the newly desired one. The token passed to this message is the raw, serialized token sent to the user.

This method may raise TokenError or ValidationError to communicate failures when parsing or consuming the token.

Parameters:
  • token (str) – The raw serialized token sent to the user
  • email (str) – The email entered by the user at password reset
  • new_password (str) – The new password to assign to the user
class flaskbb.core.auth.activation.AccountActivator[source]

Interface for managing account activation in installations that require a user to activate their account before using it.

initiate_account_activation(user)[source]

This method is abstract.

Used to extend an offer of activation to the user. This may take any form, but is recommended to take the form of a permanent communication such as email.

This method may raise ValidationError to communicate a failure when creating the token for the user to activate their account with (such as when a user has requested a token be sent to an email that is not registered in the installation or the account associated with that email has already been activated).

Parameters:user (User) – The user that the activation request applies to.
activate_account(token)[source]

This method is abstract.

Used to handle the actual activation of an account. The token passed in is the serialized token communicated to the user to use for activation. This method may raise TokenError or ValidationError to communicate failures when parsing or consuming the token.

Parameters:token (str) – The raw serialized token sent to the user