{"slug": "the-simplest-way-to-add-login-to-an-app-you-built-with-ai", "title": "The simplest way to add login to an app you built with AI", "summary": "A developer writing under the Infrastructure line, attributed to Ciro Cesar Maciel, released Auth, a passwordless sign-in service designed to be integrated by AI coding agents such as Claude Code and Cursor. The service eliminates sign-up, password reset and e-mail verification flows, and ships an llms.txt file at myinfrastructure.click that gives agents a five-step React integration plus an explicit list of nonexistent methods so they don't invent signUp or forgotPassword. The React package @ciromaciel/auth-react uses a public pu_ key in the frontend and a secret ak_ key server-side, with the Protect component requiring an explicit redirectTo since its default /login route does not exist.", "body_md": "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.\n\nThis is how it works with Auth, from the Infrastructure line (by Ciro Cesar Maciel, who writes this).\n\nMost 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:\n\nThe 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.\n\nAuth 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.\n\nThe 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:\n\n```\nVITE_AUTH_PUBLIC_KEY=pu_...\n```\n\nNo 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.\n\nIn a React + Vite app:\n\n`@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`.\nOn `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.", "url": "https://wpnews.pro/news/the-simplest-way-to-add-login-to-an-app-you-built-with-ai", "canonical_source": "https://dev.to/ciromaciel/the-simplest-way-to-add-login-to-an-app-you-built-with-ai-43pg", "published_at": "2026-11-18 10:09:12+00:00", "updated_at": "2026-11-18 10:13:46.781839+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools", "agent-protocols"], "entities": ["Auth", "Infrastructure", "Ciro Cesar Maciel", "Claude Code", "Cursor", "@ciromaciel/auth-react", "React", "Vite"], "also_reported_by": [], "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.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/the-simplest-way-to-add-login-to-an-app-you-built-with-ai", "markdown": "https://wpnews.pro/news/the-simplest-way-to-add-login-to-an-app-you-built-with-ai.md", "text": "https://wpnews.pro/news/the-simplest-way-to-add-login-to-an-app-you-built-with-ai.txt", "jsonld": "https://wpnews.pro/news/the-simplest-way-to-add-login-to-an-app-you-built-with-ai.jsonld"}}