Logins for your app
Add sign-up and login so every person who uses your app gets their own account and sees only their own data. Choose Google Sign-In, email + password, magic link, or any mix.
What it does
Logins give every person who uses your app their own account. Once someone signs in, your app can greet them by name, save their work, and show only their own records - so two different users never see each other's data. It is the building block behind profiles, "my orders", saved favorites, dashboards, and anything that should be private to one person.
You pick how people sign in. Google Sign-In is fastest for users who already have a Google account, magic link is the easiest because there is no password to remember, and email + password is the familiar option for users who log in repeatedly across devices. You can offer more than one, and they work together for the same account.
How to add it
Just ask in chat - for example, "add login so each user has their own account" or "let people sign in with Google." GenMB adds the sign-up and login screens, wires them to your app, and saves only what each user is allowed to see. You can follow up to change the look, switch sign-in methods, or gate certain pages behind login.
The AI also auto-detects when your app needs accounts from your original prompt. You can turn methods on or off any time in the Services panel, and the sign-in flow updates on your next save.
Auth Methods
Your generated app can authenticate end-users with any combination of:
Google Sign-In
Zero-config OAuth flow. Fastest for users who already have a Google account.
Email + Password
Classic signup / login with bcrypt-hashed passwords. OTP confirms email before account is created.
Magic Link
Passwordless. User receives an email with a one-time link that signs them in.
Sessions
Once someone signs in, your app remembers them until they sign out or their session expires - they do not have to log in again on every visit. Sign-ins are kept separate per app, so a user logged into one of your apps is not automatically logged into another, even with the same email. This keeps each app's user list independent.
Limits
- Magic-link rate limit: 3 sends per email+app per 15-minute window, 10 per IP.
- OTP (email confirmation code) lifetime: 15 minutes.
- Pending signup details are held for 15 minutes before they expire.
- Only your own deployed app can trigger sign-in - other sites cannot call your app's login.
- Available on all plans, including Free.
For developers
Everything below is optional. GenMB writes this for you when you ask in chat - it is here if you want to wire the auth SDK by hand or understand exactly what runs.
Google Sign-In
GenMB hosts the OAuth client and callback. You do not need to register a project in Google Cloud or copy a client secret.
await window.genmb.auth.signIn() // opens Google popup, returns when done
const user = window.genmb.auth.getUser() // { id, email, name, avatarUrl } or null
await window.genmb.auth.signOut()Email + Password
Sign up requested
OTP verified
appUsers/{appId}~{email} and a session cookie is set.Subsequent logins
Forgot password
Magic Link
The simplest UX. User enters an email and clicks the link in the message GenMB sends. The SDK auto-verifies the token on page load via ?magic_token=... and the user is signed in.
await window.genmb.auth.sendMagicLink({ email: 'user@example.com' })
// User clicks email link; redirected back signed in.SDK Usage
All methods funnel into a unified window.genmb.auth object so your UI code does not need to branch on method:
window.genmb.auth.getUser() // current user or null
window.genmb.auth.onChange(user => {}) // subscribe to sign-in / sign-out
await window.genmb.auth.signOut() // works for any methodCombine with RBAC to gate features by role, and with app data to scope records to user.id.
Under the hood
- Accounts live in
appUsers/{appId}~{email}, separate from platform (GenMB) users. - Passwords are hashed with bcrypt before storage; plaintext never lands in the database.
- Sessions live server-side in
appAuthSessions, referenced from agenmb_auth_sessioncookie scoped to your app domain. The cookie is HttpOnly and Secure, so it cannot be read from JavaScript. - Reset-request and signup endpoints always return a generic 200 so they can't be used to discover which emails are registered.
FAQs
How is this different from the auth I use to sign into GenMB?▾
Which auth method should I pick?▾
Can I use more than one method in the same app?▾
Where do sessions live?▾
Are passwords stored safely?▾
Ready to build?
Create your first app for free, no credit card required.