AddThisFeature

Password Reset

Let people back in without opening a hole for everyone else.

moderate User Accounts

What it adds

A request-and-reset flow with expiring single-use tokens, identical public responses regardless of whether the account exists, and session cleanup afterwards.

What your agent is told to do

5
  1. 1

    Return the same message and the same rough response time whether or not the address has an account. The reset form is the most common account-enumeration oracle in any app.

  2. 2

    Store tokens hashed, expire them within an hour or so, and consume them on use.

  3. 3

    After a successful reset, revoke all other sessions and notify the account by email that the password changed.

  4. 4

    Rate-limit both the request step and the token-submission step, per address and per IP.

  5. 5

    Do not sign the user in automatically from the reset link alone unless the app has decided that link possession equals authentication. Say which you chose and be consistent.

Edge cases it handles

6
  • Requesting several resets must leave exactly one usable token — invalidate the earlier ones and say so in the email.
  • A reset link opened after the password already changed must show a neutral expired state, not an error mentioning the account.
  • Return-to URLs carried through the flow must be validated against an allowlist; an open redirect here hands over the session.
  • Reset tokens must never appear in query strings that get logged, sent as referrers, or captured by analytics.
  • If 2FA is enabled, resetting the password must not bypass it.
  • The reset must reject the current password if the app forbids reuse, without confirming what the old one was.

Definition of done

8
  • Request responses are identical for existing and non-existing addresses.
  • Tokens are hashed, expiring, and single-use, with older tokens invalidated on reissue.
  • A successful reset revokes other sessions and emails the account.
  • Return destinations are validated against an allowlist.
  • Both request and submission steps are rate-limited.
  • Reset does not bypass two-factor authentication.
  • The feature matches the existing design system.
  • No existing functionality is broken.

Related features

How it works

  1. 1

    Copy the link

    Grab the Markdown instruction URL for this feature.

  2. 2

    Give it to your AI

    Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.

  3. 3

    It inspects, then implements

    Your agent reads your existing app first, then adds the feature to fit it.

Works with your stack

These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.

Need it tighter than that? Customize the feature and tell it exactly what you're running.