Build an authentication flow
Have Autohand Code use authentication skill guidance to add email, OAuth, session handling, callbacks, and protected route checks.
Build an authentication flow with Autohand Code is a product security workflow that implements sign-in, OAuth or email flows, session handling, callbacks, protected routes, and tests using the project auth stack.
At a glance
| Question | Answer |
|---|---|
| Best for | new auth setup, provider integration, protected app areas, session bugs, and login flows that need tests |
| Primary inputs | Auth provider, user model, callback URLs, and session requirements; Protected routes, roles, and redirect behavior; Environment variables, local test users, and security constraints |
| Autohand Code returns | An auth flow with secure session handling, route protection, config notes, and validation tests. |
| Avoid when | the identity provider, user model, or access policy is not decided |
How Autohand Code handles this workflow
- Finds the app routing, middleware, session, and user model patterns.
- Adds provider config, callbacks, session checks, and protected routes through existing conventions.
- Keeps secrets in environment configuration and documents required values.
- Adds tests or browser checks for sign-in, sign-out, redirects, and denied access.
Best inputs
- Auth provider, user model, callback URLs, and session requirements
- Protected routes, roles, and redirect behavior
- Environment variables, local test users, and security constraints
Strong prompt
autohand -p "Build this authentication flow with session handling, protected routes, and tests"
Autohand Code CLI options
- Use
/skills use better-auth-best-practicesor a provider-specific auth skill when installed. - Run
autohand -p "Build this authentication flow with session handling, protected routes, and tests"with the provider and routes. - Use
--restrictedfor planning when secrets or identity settings are visible.
Review before accepting
Review session storage, redirect behavior, protected route checks, env docs, and tests for allowed and denied access.
Source and validation signals
Autohand AI maintains this workflow as first-party product guidance for Autohand Code. Use the Autohand Code CLI Playbook, CLI reference, and configuration reference when choosing between interactive mode, command mode, auto-mode, feature-enabled /goal, /settings, skills, MCP, and permission settings. The related resources below link to product docs and tutorials for the workflow, and the final answer should name repository-specific files, commands, outputs, or docs that a reviewer can verify.
Frequently asked questions
What is Build an authentication flow with Autohand Code?
Build an authentication flow with Autohand Code is a product security workflow that implements sign-in, OAuth or email flows, session handling, callbacks, protected routes, and tests using the project auth stack.
When should a team use Build an authentication flow?
Use it when authentication touches product routing, backend sessions, and security policy together.
What evidence should reviewers check for Build an authentication flow?
Review session storage, redirect behavior, protected route checks, env docs, and tests for allowed and denied access.