You asked Claude Code, Cursor or another agent for an app, and it works. Now it needs login, and the agent's first instinct is to build it all: a users table, password hashing, confirmation e-mails, a "forgot password" screen. Each piece is a place where an app built in a hurry leaves a door open. The simplest way is to build none of them: use a sign-in service the agent can integrate by reading documentation written for it.
This is how it works with Auth, from the Infrastructure line (by Ciro Cesar Maciel, who writes this).
Why passwordless is the simple path
Most of the work of a traditional login exists because of the password: it has to be hashed, have rules, be recoverable, and it becomes a target for leaks and reuse. Auth removes it. People sign in three ways:
- A code by e-mail. They type the e-mail, get an 8-character code and paste it. The e-mail carries a code, not a link, so there is no return URL to configure and no callback to hijack.
- Google, when the app owner turns on their credentials in the dashboard.
- Apple, the same way.
The account is created by the first code, already verified. There is no separate sign-up, magic link, password reset or e-mail verification, because there is no password to recover.
The path with the agent
1. Give the agent the right documentation
Auth has one file with everything a developer or an agent needs: https://myinfrastructure.click/products/auth/llms.txt. It starts with a five-step React login and has a section on what does not exist, so the agent does not invent signUp or forgotPassword. Paste the URL and ask for the integration.
2. The public key
The frontend needs a public key starting with pu_. It can ship in the bundle. It lives in the Auth dashboard under API Keys of the application:
VITE_AUTH_PUBLIC_KEY=pu_...
No account yet? The agent can create the account, the application and the keys itself, through the same e-mail code; your only step is reading the code and telling it. A backend uses the secret ak_ key, server side only.
3. What the agent writes
In a React + Vite app:
- Install
@ciromaciel/auth-reactand the UI dependencies it uses. - Wrap the app in
AuthProviderwith the public key. - Add the
/auth/signinroute with theSignIncomponent. - Protect signed-in routes with
Protect, always withredirectTo="/auth/signin". Its default points to/login, which does not exist: the most common mistake. - Optionally add
UserProfile.
On localhost the first sign-in works with no origin to allow. In production, Auth learns the app's origin from the first visit from a real domain, or you set it in the dashboard. Preview hosts such as *.vercel.app or *.pages.dev sign in normally but never become the official origin.
When the path is different
- Next.js without React Router. The components use React Router inside. In plain Next, integrate through the HTTP API, which runs the same code flow.
- You need passwords. Auth has none, by design.
- Fine-grained permissions. Sign-in gives you the person's identity, isolated per application. Organizations and roles exist in Auth's admin dashboard but do not reach the app through the SDK or the token; who can do what stays in your app.
Honest notes
- The
SignIncomponent is the whole screen, with e-mail, code and the Google and Apple buttons when enabled, themed to your app's color. - Same e-mail, same account, whether by code or by Google.
- After launch, Auth's MCP server lets an agent administer the app (list users, stats, revoke sessions) with your browser sign-in. The MCP administers; the SDK is what puts login inside the app.
- The Auth dashboard has English (Language in the account menu). The first application is free, no card, no expiry.
Top comments (0)