# Authentication overview
Source: https://sovaria.in/docs/auth-overview

Sign-in methods for your app users, how sessions work, and the settings that control them.

Sovaria Auth manages the people who use **your app** — your project's app users. They are separate from your console team, live only in your project, and every request they make is checked by your [policies](https://sovaria.in/docs/row-level-security).

## Sign-in methods

| Method | Use it when | Guide |
|---|---|---|
| Email and password | The classic sign-up form. | [Email and password](https://sovaria.in/docs/email-and-password) |
| Magic link and code | Passwordless sign-in by email (link or 6-digit code). | [Magic links and email codes](https://sovaria.in/docs/magic-links) |
| Social sign-in | Google, GitHub, Microsoft, Apple, GitLab, Discord and more. | [Social sign-in](https://sovaria.in/docs/social-sign-in) |
| Anonymous | Let people try your app before creating an account. | Turn on under **Users → Sign in / Providers** |

Turn methods on or off under **Users → Sign in / Providers**. A method that is off is refused by the API, not just hidden in your UI.

## Let people sign up

New projects only allow users you invite or create. To let anyone create an account from your app, turn on **Allow new users to sign up** (Sign in / Providers — the same switch appears as **Public app sign-up** under Security & JWT). While it is off, sign-ups from your app fail with `403` and you add users from the **Users** page or your server.

## Sessions

- Signing in returns an **access token** (valid 15 minutes) and a **refresh token** (valid 7 days by default).
- The SDKs refresh the access token automatically before it expires.
- Signing out (`sovaria.auth.logout()`) revokes the refresh token and the current access token at once (every server refuses that access token within 3 seconds).
- Changing or resetting a password signs the user out on every other device.

Under **Authentication → Sessions** you can tighten this for every app user of the project (Pro plan and above):

| Setting | Effect | Default |
|---|---|---|
| Single session per user | Signing in on a new device signs the user out everywhere else. | Off |
| Time-box | Maximum session length since sign-in; then the refresh fails with *Session time limit reached. Sign in again.* | 0 (never) |
| Inactivity timeout | Sign the user out when the app hasn't refreshed the session for this long. | 0 (never) |
| Refresh token reuse interval | If the same refresh token is presented again within this many seconds (two tabs refreshing at once), both get the same new tokens instead of an error. | 10 s |

**Authentication → Your sessions** is different: it lists the devices where *you* are signed in to the Sovaria console. To sign one app user out everywhere, open them in **Users**.

## Settings that matter

| Setting | Where | What it does |
|---|---|---|
| Who may sign up, email confirmation | Sign in / Providers | Open sign-up or invite-only; require users to confirm their email first. |
| Site URL and redirect URLs | URL configuration | Where email links and social sign-in send people back to. Other URLs are refused. |
| Sessions | Sessions | Single session per user, time-box, inactivity timeout, refresh token reuse (see above). |
| Rate limits and attack protection | Rate limits / Attack protection | Caps sign-in attempts and sign-up bursts per IP and per email; leaked-password check; CAPTCHA. |
| MFA and passkeys | Multi-factor / Passkeys | Second factors and passwordless device keys. |
| Emails | Email | Sender (your own SMTP) and the text of every email ([Auth emails](https://sovaria.in/docs/auth-emails)). |
| Password rules, custom JWT claims | Security & JWT | Minimum length and character rules; extra claims in access tokens. |

## Built-in protections

- Passwords are hashed with bcrypt and never stored or logged in plain text.
- Sign-up, password reset, magic-link and SMS-code requests return the same response, in the same time, whether or not the email or number has an account, so accounts can't be discovered. Someone who tries to sign up with an existing address only triggers an email to that address.
- An account whose email was never confirmed may have been registered by someone else. The first time the inbox owner proves the address (a magic link, an email code, social or SSO sign-in, or a password reset), everything else that could sign in to it is removed: password (except a new one set by the reset), passkeys, MFA factors, linked identities, the phone number and all sessions.
- Links and codes work once and expire (magic links 15 minutes, email confirmation 24 hours).
- Users get an email when someone signs in from a new device or their password changes (on by default; **Security & JWT → Security alert emails**).
