nova_auth_reset (nova_auth v0.2.0)

View Source

Password reset token management. Generates time-limited reset tokens and handles the reset flow, invalidating all existing tokens on success.

Summary

Functions

Generate and store a password reset token for a user. Returns the raw token.

Reset a user's password using a raw reset token. Invalidates all tokens on success.

Functions

generate_reset_token(AuthMod, User)

-spec generate_reset_token(module(), map()) -> {ok, binary()} | {error, term()}.

Generate and store a password reset token for a user. Returns the raw token.

reset_password(AuthMod, Token, NewParams)

-spec reset_password(module(), binary(), map()) -> {ok, map()} | {error, term()}.

Reset a user's password using a raw reset token. Invalidates all tokens on success.