Add authentication to an existing app with a prompt built for Cursor and Claude. It supplies context, constraints and an output contract, then asks the model to surface assumptions and gaps. Copy it, fill the variables and treat the result as a structured draft, not a final answer.
4.9(58 ratings)700 copies
Updated By Site Admin
42 words · v1.2
Fill in the blanks · 2 variables
Cursor promptReplace every highlighted token before sending
Add email and OAuth authentication to this app. First produce a plan: data model, session strategy, routes, protected pages, token refresh and logout. Then implement incrementally. Use {auth_library}. Do not log secrets. Include tests for session expiry and unauthorised access.
Stack:
{stack}
---
Platform note: Read the relevant files first. Propose a short plan, make the smallest correct change, then run the tests and report the result. Do not modify unrelated code.
Share what worked, what broke and which model you used. Comments appear after posting and are moderated for spam.
How to use this prompt
1
Open Cursor and start a new chat. Paste the prompt exactly as written.
2
Replace each placeholder ({auth_library}, {stack}) with your own details. Leave the instructions and the output format untouched.
3
Add one concrete example or data point if the model's first answer is vague. Specific input produces specific output.
4
Run it once, then ask for a single revision with a specific critique rather than regenerating from scratch.
5
Review the result. Reproduce the bug, review the diff and run the tests in a clean environment.
Worked example
This is the kind of input the prompt expects and the shape of output it produces. Your result will differ with the model and the details you supply.
Example input
Auth library: your auth library
Stack: Next.js, Postgres, Drizzle
Example output
**Diagnosis:** the handler reads `req.body` before the JSON middleware runs, so the body is undefined on POST requests.
**Fix:** move the middleware above the route registration and add a guard for missing bodies. No public API changes.
**Verification:** added a failing test for an empty JSON body, confirmed it fails, applied the fix, then ran the full suite. The test now passes and the unrelated snapshot tests are unchanged.
Tips for a better result
Paste the full error and the smallest relevant code, not a screenshot of the stack trace.
Ask for a plan before allowing multi-file edits; it prevents sprawling refactors.
Require a failing test first and a verification command at the end.
Change one variable at a time and compare the outputs; it is the fastest way to learn what this model responds to.
Common mistakes
Accepting a confident fix without reproducing the bug or running tests.
Letting the assistant rewrite entire files when a three-line diff would do.
Pasting secrets, tokens or customer data into a hosted model.
Verified Knowledge · FAQ
Questions about this prompt
Practical answers about running the add authentication to an existing app prompt.
Related prompts
Same job, a different angle — or the next step in the workflow.
Generate unit tests that fail before the fix with a prompt built for Cursor and Claude. It supplies context, constraints and an output contract, then asks the model to surface assumptions and gaps. Copy it, fill the variables and treat the result as a structured draft, not a final answer.
This copy-ready coding prompt helps you explain a regex with fewer blank-page decisions. Paste it into ChatGPT and Claude, fill the variables, and you get a structured first draft you can edit. It is written for repeatable results and tells you what to check before publishing.
Write a technical design document with a prompt built for Claude and ChatGPT. It supplies context, constraints and an output contract, then asks the model to surface assumptions and gaps. Copy it, fill the variables and treat the result as a structured draft, not a final answer.
ClaudeChatGPT
4.7(29)659 copies
SA
Written and reviewed by Site Admin
Author & Platform Administrator
Administrator and lead editor at AIPrompt123, curating high-performance AI prompts, SEO/AEO/GEO strategies, and developer repositories.
Last reviewed 19 April 2026 · version 1.2 · tested on Cursor, Claude, Lovable
Comments
Share what worked, what broke and which model you used. Comments appear after posting and are moderated for spam.