module

Pared::PasswordReset

Instance methods

generate_token(user_id : Int64) : String

Generates a 64-character secure recovery token and stores it in the database

Source
reset_password!(user_id : Int64, new_password : String)

Updates the user's password hash in the database

Source
use_token!(token : String)

Invalidates the token after use

Source
validate_token(token : String) : Int64 | Nil

Validates a recovery token. Returns the user_id if valid, nil otherwise

Source