c/backend › command
0votes

One-Click Password Reset

PromptLow risk
submitted by CommandVault editors to c/backend · 5 uses

Fast, secure password recovery

Prompt · 2 variables
Add a secure "Forgot password" flow.

Stack: {{stack}}
After a successful reset, send people to: {{goal}}

Requirements:
1. The request form always shows the same message, whether or not the email has an account.
2. Send a single-use token that expires in 60 minutes; store only its hash. Rate-limit requests per email and IP.
3. The reset page checks the token, enforces our password rules, and then invalidates the token and every other active session.
4. Email the user that their password was changed, with a way to report it wasn't them.
5. Redirect as described above, with a confirmation message.

List the files you'll change and give me a test plan, including reusing a token, an expired token and two tabs requesting resets.
e.g. 'the dashboard, already logged in' or 'the login page'
Framework, language and versions, e.g. Next.js 16 App Router + TypeScript
0 commentsreport

Try it here

Fill in {{goal}} above first for a better answer, or run it as is and the AI will assume sensible values.

or open in ChatGPT · Claude · Perplexity

How to use this prompt

  1. Fill in the 2 blanks above. The more specific you are, the better the answer.
  2. Copy it and paste it into ChatGPT, Claude, Gemini, Cursor or Codex, or use "Try it here" for a quick test.
  3. Read the answer critically: check anything it claims about your code or data before you rely on it.
  • {{goal}} e.g. 'the dashboard, already logged in' or 'the login page'
  • {{stack}} Framework, language and versions, e.g. Next.js 16 App Router + TypeScript

More from c/backend

See all of c/backend →
0 comments

Log in to join the discussion.