Password reset and sensitive-change verification flows.
This documentation outlines the security protocols for the Butternut application, specifically focusing on the mechanisms used to protect user accounts during recovery and sensitive profile updates.
When a user has forgotten their password or needs to regain access to their account, Butternut employs a multi-layered, single-use reset flow to ensure security.
Requesting a reset: The user initiates the process via the Reset tab or the login screen by providing their email address.
Token generation: The system creates a temporary record in the forgot_password_tokens database and generates a secure JWT (JSON Web Token). This token includes a unique ID (fp_id) and a specific expiration timestamp.
Time-limited access: The reset link sent to the user is valid for only 15 minutes. If it is not used within this window, the token expires.
Single-use guarantee: To prevent replay attacks, the database record associated with the link is atomically consumed and deleted the moment the user successfully resets their password.
Even if the 15-minute window hasn’t passed, the link becomes invalid immediately after one use.
For existing email/password accounts, the platform enforces a two-step verification process for sensitive updates to prevent unauthorised changes (for example, if a device is left unattended).
Users who sign in exclusively via Google OAuth skip this process initially because they do not have an internal password to verify.
Once a Google user sets an internal password, their account becomes hybrid, and these security measures apply to them for all future sensitive updates.
Think of the single-use password reset like a one-time digital key that dissolves as soon as it turns the lock once (or if it’s left in the sun for more than 15 minutes).The two-step verification is like a security double-check at a bank: even if you are already inside the building (logged in), the teller still asks for your ID and a signature (password and confirmation) before letting you change the name on the account.