# The simplest way to add login to an app you built with AI

> Source: <https://dev.to/ciromaciel/the-simplest-way-to-add-login-to-an-app-you-built-with-ai-43pg>
> Published: 2026-11-18 10:09:12+00:00

**Key takeaway:** Auth's llms.txt gives agents a five-step React integration and an explicit list of nonexistent methods, and its Protect component must be given redirectTo="/auth/signin" because the default /login route does not exist.

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).

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:

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.

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.

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.

In a React + Vite app:

`@ciromaciel/auth-react` and the UI dependencies it uses.`AuthProvider` with the public key.`/auth/signin` route with the `SignIn` component.`Protect`, always with `redirectTo="/auth/signin"`. Its default points to `/login`, which does not exist: the most common mistake.` 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.
