Skip to content

Harden sign-up, login and password reset

Check how passwords, sessions and resets work, and fix the gaps attackers try first.

  • Free, no sign-up
  • 1 to 2 hours with an agent
  • By Devvrat Hans
  • Version 1.0, updated Oct 26, 2026

1Your site and stack

Optional. The prompt adapts as you type; leave a field blank and the agent works it out.

2Copy it into your agent

auth-hardening.md65 lines, about 919 tokens

Paste into any coding agent: Claude Code, Cursor, Codex, Copilot, Windsurf or Cline.

# Harden sign-up, login and password reset

A public launch puts the sign-up and login of the production site in front of bots as well as people. Review how authentication works end to end and fix the gaps attackers try first, without changing how the flows look to a real user.

Site: not given. Find the production URL in the project config, or ask me.

## Ground rules

1. Read before you write. Explore the parts of the codebase this job touches and tell me what is already in place.
2. Plan, then stop. Give me a numbered plan: what you will change, in which files, and why. Wait for my approval before editing anything.
3. Fix things at their source (the shared layout, the config, the generator), not with one-off patches page by page.
4. Keep the project's conventions: its framework APIs, file layout, naming and code style. Add no new dependency without asking.
5. Where something is already done well, say so and leave it alone.

## You will not

- Edit `.env` files, secrets or API keys, or print their values.
- Deploy, push, merge or publish anything.
- Delete data, or run migrations or scripts against a production database.
- Add tracking, third-party scripts or links to any site I did not ask for.
- Change copy, design or behaviour that this job does not need.
- Replace the auth library or provider.
- Force existing users to reset their passwords.

## Your stack

- Framework: Work out the framework, router and build output from the project files (package.json, lockfiles, framework config) before planning, and say which you found.
- Host: Work out where the site is hosted from the config files (vercel.json, netlify.toml, wrangler config, Dockerfile, fly.toml) and say which you found.

## Steps

### 1. Map the auth flows

List sign-up, login, logout, password reset, email change, social or magic-link sign-in, and session handling, with the files for each. Say whether auth is a library or provider (Auth.js, Clerk, Supabase, Devise, Laravel Breeze...) or custom code: with a provider, the job is configuration, not rewriting it.

### 2. Passwords and sessions

- Passwords hashed with a slow algorithm (argon2id, bcrypt or scrypt), never stored or logged in plain text.
- Session cookies `HttpOnly`, `Secure`, `SameSite=Lax` (or `Strict`), with a sensible lifetime; sessions rotated on login and invalidated on logout and password change.
- State-changing requests protected against CSRF (the framework's built-in protection, or SameSite plus an origin check).

### 3. Abuse

Rate limit login, sign-up, password reset and verification emails per IP and per account, with a clear 429. Make login and reset answers the same whether or not the email exists, so accounts cannot be enumerated. If sign-up is open to bots, propose a light challenge (Turnstile, hCaptcha) for me to decide on.

### 4. Reset and verification tokens

Tokens must be random, single-use, short-lived (an hour or less for resets) and stored hashed. A used or expired token gives a clear message and a way to request a new one.

## Done means

- [ ] Passwords use a slow hash and never appear in logs.
- [ ] Session cookies are HttpOnly, Secure and SameSite, and sessions rotate on login.
- [ ] Login, sign-up and reset are rate limited and do not reveal whether an email exists.
- [ ] Reset and verification tokens are random, single-use, short-lived and stored hashed.
- [ ] The sign-up and login flows look and work the same for real users.

## Report back

When you finish, give me:

- what you changed, file by file;
- anything you skipped, and why;
- anything I must do by hand (DNS records, dashboards, accounts, deploys);
- how to check each change on the live site.

One-line version

For agents that can read a URL. It fetches this prompt with your settings applied.

Read https://abacklaunch.com/prompts/auth-hardening.md and follow it for this project.

3Check the result

When the changes are live, run these free checks. Add your site URL above and each one opens already running on it.

This prompt will not

  • Edit .env files, secrets or API keys, or print their values.
  • Deploy, push, merge or publish anything.
  • Delete data, or run migrations or scripts against a production database.
  • Add tracking, third-party scripts or links to any site I did not ask for.
  • Change copy, design or behaviour that this job does not need.
  • Replace the auth library or provider.
  • Force existing users to reset their passwords.

It reads your code first, shows you a plan, and waits for your approval before it changes anything.

What you get

  • A map of your auth flows and their files
  • Hardened passwords, sessions and tokens
  • Rate limits and enumeration-safe answers on login, sign-up and reset

How to use this prompt

  1. 1

    Describe your stack

    Add your site, framework and host. The prompt adapts; blank fields are left for the agent to work out.

  2. 2

    Paste it into your agent

    Open your project in Claude Code, Cursor, Codex, Copilot, Windsurf or Cline, and paste the prompt or the one-line version.

  3. 3

    Approve the plan

    The agent reads your code, shows you a plan with the files it will touch, and waits. Change anything you disagree with.

  4. 4

    Check the result

    When the changes are live, run the free checks below on your site to confirm each fix.

What the agent does

A public launch puts the sign-up and login of the production site in front of bots as well as people. Review how authentication works end to end and fix the gaps attackers try first, without changing how the flows look to a real user.

  1. 1. Map the auth flows

    List sign-up, login, logout, password reset, email change, social or magic-link sign-in, and session handling, with the files for each. Say whether auth is a library or provider (Auth.js, Clerk, Supabase, Devise, Laravel Breeze...) or custom code: with a provider, the job is configuration, not rewriting it.

  2. 2. Passwords and sessions

    • Passwords hashed with a slow algorithm (argon2id, bcrypt or scrypt), never stored or logged in plain text.
    • Session cookies HttpOnly, Secure, SameSite=Lax (or Strict), with a sensible lifetime; sessions rotated on login and invalidated on logout and password change.
    • State-changing requests protected against CSRF (the framework's built-in protection, or SameSite plus an origin check).
  3. 3. Abuse

    Rate limit login, sign-up, password reset and verification emails per IP and per account, with a clear 429. Make login and reset answers the same whether or not the email exists, so accounts cannot be enumerated. If sign-up is open to bots, propose a light challenge (Turnstile, hCaptcha) for me to decide on.

  4. 4. Reset and verification tokens

    Tokens must be random, single-use, short-lived (an hour or less for resets) and stored hashed. A used or expired token gives a clear message and a way to request a new one.

Done means

  • Passwords use a slow hash and never appear in logs.
  • Session cookies are HttpOnly, Secure and SameSite, and sessions rotate on login.
  • Login, sign-up and reset are rate limited and do not reveal whether an email exists.
  • Reset and verification tokens are random, single-use, short-lived and stored hashed.
  • The sign-up and login flows look and work the same for real users.

Questions

I use Clerk, Auth0 or Supabase. Is this still useful?

Yes, but the agent works on configuration: session lifetime, rate limits, email verification and how your app uses the session, rather than rewriting what the provider does well.

Why make login answers the same for unknown emails?

Different answers let anyone check which emails have accounts, which helps targeted phishing and credential stuffing.

Do I need a captcha?

Not always. Rate limits stop most abuse. If bots still create accounts, a light challenge such as Turnstile is the next step, and the prompt asks you before adding one.

Does this prompt add links to Aback Launch to my site?

No. Nothing in the prompt mentions Aback Launch or asks your agent to link to us. The only exception is an optional badge step, which stays off unless you tick it. Some prompt libraries slip their own link into your codebase by default; we think that should always be your choice.

Which coding agents does it work with?

Claude Code, Cursor, Codex, GitHub Copilot, Windsurf, Cline, and any agent that can read your project and edit files. You can copy it as a plain prompt, save it as a Claude Code skill or a Cursor rule, or add it to AGENTS.md.

Is it safe to run on my real codebase?

The prompt makes the agent read first, show a plan and wait for your approval, and it forbids touching secrets, deploying and deleting data. Still review the changes and run your tests before you deploy, as with any change.

Changelog

  • v1.0First version.

Launch your startup on Aback Launch

Get a launch page that search engines and AI assistants can read, a place in the weekly launch list, and a review by a real person. Free to join.