# How to add login to an app Claude built

Two ways to add login to an app Claude or Claude Code built on floo: invite-only sign-in for your team with one line of config, or sign-up and sign-in for your app's own users, stored in your Postgres. Which to pick and how to turn each on.

Canonical URL: https://getfloo.com/blog/how-to-add-login-to-an-app-claude-built

## TL;DR

**To add login to an app Claude built, pick who signs in. For your team, set `access_mode = "accounts"` and invite people: floo handles sign-in and tells the app who each person is, with no auth code. For customers or the public, add `[managed.default.users]` and Claude builds sign-up and sign-in pages against floo's hosted sign-in service.**

- **Team app:** one line of config, invite-only, no login page to build.
- **Public app:** email and password sign-in, plus Google or GitHub with your own OAuth app, users stored in your Postgres.
- Either way, sign-in runs on floo, so Claude never writes a session store or a password table.

Login is where a lot of apps Claude builds stall. The first version works, then someone asks for "just a login," and the next hour goes to sessions, password resets, and an OAuth app. On floo, login is configuration, and the choice is who it is for.

## Which login does the app need?

| | Team sign-in | User accounts |
| --- | --- | --- |
| Who signs in | People you invite | Anyone who signs up |
| Good for | Internal tools, dashboards, approval flows | Customer portals, public apps |
| Config | `access_mode = "accounts"` | `[managed.default.users]` |
| Who builds the login page | floo | Claude, using the sign-in client |
| Where people are stored | floo accounts | Your app's Postgres |

If you would describe the app as "for my team," pick team sign-in.

## Team sign-in: one line

Ask Claude Code:

> Make this app invite-only on floo. Read the signed-in user from the X-Floo-User-Email header and show their name in the header.

The config change is:

```toml floo.app.toml
[app]
name = "requests"
access_mode = "accounts"
```

Push, and every page now asks for sign-in first. Invite people:

```bash
floo apps invite sam@example.com --role member --app requests
```

In Claude chat with the floo connector, say "Invite sam@example.com to the app." Apps created from chat start invite-only.

Every request reaches the app with `X-Floo-User-Email`, `X-Floo-User-Name`, and `X-Floo-User-Role`. floo strips any `X-Floo-*` header a browser sends, so the app can trust them. That is what rules like "only admins can approve" are built on. The longer version is in [add sign-in to an internal app without auth code](https://getfloo.com/blog/add-sign-in-to-an-internal-app-without-auth-code).

## User accounts: sign-up for the public

For an app people sign up to, keep the app public and turn on accounts on its database:

```toml floo.app.toml
[managed.default]
type = "postgres"

[managed.default.users]
methods = ["email_password"]
signup = "open"
```

Then ask Claude:

> Add sign-up, sign-in, and forgot-password pages using the better-auth client. Users confirm their email with the 6-digit code. Protect /account so only signed-in users see it.

floo serves sign-in at `/api/auth` on the app's own domain, sends the verification and reset codes, and keeps users in a `floo_auth` schema next to your tables. Claude writes the pages and the session check.

Google, GitHub, and Microsoft sign-in work too. Each needs your own OAuth app per environment, so the consent screen shows your app's name: add the provider to `methods`, deploy, then give floo the client id and secret for dev and for prod. The steps are in [User accounts](https://getfloo.com/docs/guides/user-accounts#social-sign-in).

Two settings cover most needs. `signup = "closed"` stops new sign-ups. `allowed_email_domains = ["example.com"]` lets only one company's addresses in.

## Test login without a mailbox

In dev, any `@test.getfloo.app` address signs up with the code `000000`. Claude Code can create a user, sign in, and check the protected pages on its own. Prod refuses those addresses. If you set `allowed_email_domains`, add `"test.getfloo.app"` to the list so these test sign-ups still work.

The full reference is in [App sign-in](https://getfloo.com/docs/guides/app-auth) and [User accounts](https://getfloo.com/docs/guides/user-accounts). For the app around the login, see [how to build a web app with Claude](https://getfloo.com/blog/how-to-build-a-web-app-with-claude).

## FAQ

### How do I add login to an app Claude built?

For a team app, set access_mode = "accounts" in floo.app.toml and invite people. floo puts sign-in in front of every page and tells the app who each person is. For an app the public signs up to, add [managed.default.users] to the app's Postgres and Claude adds sign-up and sign-in pages.

### Does Claude need to write auth code for team sign-in?

No. With access_mode = "accounts", floo's gateway handles the sign-in page, the session, and sign-out. The app reads the person's email from the X-Floo-User-Email header.

### Where do user accounts live for a public app?

In the app's own Postgres, in a floo_auth schema next to your tables. floo runs the sign-in service at /api/auth on the app's domain, and dev and prod have separate users.
