cd /news/ai-agents/the-simplest-way-to-add-login-to-an-… · home › topics › ai-agents › article
[ARTICLE · art-171700] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

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

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.

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.

by read2 min views11 publishedNov 18, 2026

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.

── more in #ai-agents 4 stories · sorted by recency
── more on @auth 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/the-simplest-way-to-…] indexed:0 read:2min 2026-11-18 · —