Skip to content

Password Reset

password_reset

Password reset adapter interface.

Defines the abstract interface for password reset token storage and retrieval. Inherits from BaseTokenAdapter for common token operations.

Classes

PasswordResetAdapter

Bases: BaseTokenAdapter[Any]

Abstract base class for password reset token database operations.

Inherits from BaseTokenAdapter and provides backward compatibility with the mark_used() method.

Functions
mark_used
mark_used(*, token_hash: str) -> None

Mark a password reset token as used.

This is a convenience method that calls invalidate().

Parameters:

Name Type Description Default
token_hash str

Hashed token to mark as used

required
Source code in fastauth/adapters/base/password_reset.py
def mark_used(self, *, token_hash: str) -> None:
    """
    Mark a password reset token as used.

    This is a convenience method that calls invalidate().

    Args:
        token_hash: Hashed token to mark as used
    """
    self.invalidate(token_hash=token_hash)