@protobase/cli 0.103.0 → 0.104.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.103.0";
2
+ var version = "0.104.0";
3
3
  //#endregion
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.103.0",
3
+ "version": "0.104.0",
4
4
  "description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -43,13 +43,13 @@
43
43
  "dependencies": {
44
44
  "@better-auth/core": "^1.7.12",
45
45
  "@hono/node-server": "^2.1.3",
46
- "@protobase/config": "0.103.0",
47
- "@protobase/layout": "0.103.0",
48
- "@protobase/query": "0.103.0",
49
- "@protobase/schema": "0.103.0",
50
- "@protobase/server": "0.103.0",
51
- "@protobase/ui": "0.103.0",
52
- "@protobase/workflows": "0.103.0",
46
+ "@protobase/config": "0.104.0",
47
+ "@protobase/layout": "0.104.0",
48
+ "@protobase/query": "0.104.0",
49
+ "@protobase/schema": "0.104.0",
50
+ "@protobase/server": "0.104.0",
51
+ "@protobase/ui": "0.104.0",
52
+ "@protobase/workflows": "0.104.0",
53
53
  "@react-email/render": "^2.1.0",
54
54
  "@scalar/hono-api-reference": "^0.12.10",
55
55
  "@sentry/vite-plugin": "^11.10.0",
@@ -19,6 +19,7 @@ Sign-in methods, users, roles, organizations and tokens.
19
19
  - [Changing the address](../reference/auth.md#changing-the-address): People move their account to a new email address from the account page, once they enter the code sent there.
20
20
  - [Deleting the account](../reference/auth.md#deleting-the-account): People delete their own account from the account page, after confirming it, in the web app and the mobile app. On by default; an app whose accounts an organization's admins manage turns it off.
21
21
  - [Open sign-up](../reference/auth.md#open-sign-up): Anyone can create an account after confirming an emailed code.
22
+ - [Sign-up for email domains](../reference/auth.md#sign-up-for-email-domains): Open sign-up can take only addresses at your company's email domains, so colleagues make their own account and everyone else still needs an invitation.
22
23
  - [Passkeys](../reference/auth.md#passkeys): People sign in with their device's face or fingerprint unlock, or with a security key.
23
24
  - [Two-factor authentication](../reference/auth.md#two-factor-authentication): A second step with an authenticator app, backup codes or emailed codes.
24
25
  - [Emailed confirmation code](../reference/auth.md#emailed-confirmation-code): Someone without a passkey or a second step confirms it's them with a code emailed on request, where they are, such as before a secret is shown.
@@ -29,6 +30,7 @@ Sign-in methods, users, roles, organizations and tokens.
29
30
  - [Connected accounts](../reference/auth.md#sign-in-links-and-connected-accounts): People link GitHub or another sign-in provider to their account from the account page.
30
31
  - [SAML sign-in](../reference/auth.md#sign-in-with-saml): People sign in through any SAML provider.
31
32
  - [OpenID Connect provider](../reference/auth.md#platform-sign-in-provider): A host adds an OpenID Connect provider for people who already have an account.
33
+ - [Token sign-in](../reference/auth.md#token-sign-in): A client that holds a fresh ID token from that provider for this app signs in with it once, in place of an emailed code, and gets the app's own session, with the app's second step when one is on.
32
34
  - [Staff sign-in](../reference/auth.md#staff-sign-in): The team that runs an app signs in as a person to help them, with a reason and a log entry.
33
35
  - [Roles](../reference/auth.md#roles): A user holds one or more roles and switches between them without signing in again.
34
36
  - [Organizations](../reference/auth.md#organizations): People work in one organization at a time, see only its records, and are invited with their own roles.
@@ -92,10 +92,11 @@ The store's migrations then make nothing of the user table, which a migration of
92
92
  | `PROTOBASE_ORIGINS` | the other origins the app is served on, comma separated, passed by the platform; see [Several origins](#several-origins) |
93
93
  | `PROTOBASE_PASSKEY_DOMAIN` | the host new [passkeys](#passkeys) are made for, passed by the platform; default the host of the app's `url` |
94
94
  | `PROTOBASE_LOCKED_ACCOUNTS` | the addresses of accounts no one may take over, comma separated, passed by the platform, such as a demo's shared account: their address, password, passkeys, two-factor authentication, linked accounts and [personal access tokens](personal-access-tokens.md) stay as they are, from any endpoint or host call, which fails with `403 ACCOUNT_LOCKED`, and they cannot be deleted |
95
+ | `PROTOBASE_SIGN_UP_DOMAINS` | the email domains [open sign-up](#sign-up-for-email-domains) takes, comma separated, passed by the platform: it replaces `signUp.domains`, and empty it leaves open sign-up off |
95
96
  | `PROTOBASE_CORS_ORIGINS` | other websites whose browser code may call the API, `*` or comma separated http and https origins, passed by the platform; see [CORS](api.md#cors) |
96
97
  | `PROTOBASE_SMTP_URL`, `PROTOBASE_MAIL_FROM` | the mail server and sender for [password reset](#password-reset), [emailed sign-in codes](#emailed-sign-in-codes), emailed [two-factor](#two-factor-authentication) codes and [open sign-up](#open-sign-up), passed by the platform; all four are off without them |
97
98
  | `PROTOBASE_APP_NAME` | the app's name, passed by the platform: it overrides `name` |
98
- | `PROTOBASE_SIGN_IN_ISSUER`, `PROTOBASE_SIGN_IN_CLIENT_ID`, `PROTOBASE_SIGN_IN_CLIENT_SECRET` | the [platform sign-in provider](#platform-sign-in-provider) for people who have an account, passed by the platform; off without them. `PROTOBASE_SIGN_IN_PROVIDER` and `PROTOBASE_SIGN_IN_NAME` are optional |
99
+ | `PROTOBASE_SIGN_IN_ISSUER`, `PROTOBASE_SIGN_IN_CLIENT_ID`, `PROTOBASE_SIGN_IN_CLIENT_SECRET` | the [platform sign-in provider](#platform-sign-in-provider) for people who have an account, passed by the platform; off without them. `PROTOBASE_SIGN_IN_PROVIDER` and `PROTOBASE_SIGN_IN_NAME` are optional, and `PROTOBASE_SIGN_IN_TOKENS=true` turns on its [token sign-in](#token-sign-in) |
99
100
  | `PROTOBASE_OPERATOR_ISSUER`, `PROTOBASE_OPERATOR_CLIENT_ID`, `PROTOBASE_OPERATOR_CLIENT_SECRET` | the [operator provider](#operator-provider) its staff sign in with to sign in as people, passed by the platform; staff sign-in is off without them. `PROTOBASE_OPERATOR_NAME` and `PROTOBASE_OPERATOR_GROUP` are optional |
100
101
  | `PROTOBASE_TRUSTED_PROXIES` | the proxies in front of `protobase serve`, addresses or CIDR ranges, comma separated, such as `172.30.87.1`, the Docker network's gateway in the [compose template](../guides/deploy.md#compose-template); see [Client addresses](#client-addresses) |
101
102
 
@@ -360,6 +361,22 @@ The sign-in page then offers "Create an account", and so do [sign-in prompts](ui
360
361
  - The `onUserCreated` [hook](#hooks) runs for every account made this way.
361
362
  - `createAuthSession` from `@protobase/client` has the three steps as `sendSignUpCode(email)`, `verifySignUpCode(email, code)`, which resolves to the ticket, and `signUp({ ticket, name, password? })`, which resolves to the signed-in user.
362
363
 
364
+ ### Sign-up for email domains
365
+
366
+ A company's app can let colleagues make their own account while everyone else still needs an invitation, with the email domains open sign-up takes:
367
+
368
+ ```ts
369
+ auth: { roles: ['admin', 'member'], signUp: { role: 'member', domains: ['example.com'] } }
370
+ ```
371
+
372
+ - An address at one of `domains` (subdomains count, letter case does not) signs up as above, with the emailed code; domains are matched as [SAML providers'](#sign-in-with-saml) are.
373
+ - Any other address is refused at each step with `403` (`EMAIL_DOMAIN_NOT_ALLOWED`) before anything is mailed or made, and the sign-up page says the address cannot make an account here. The answer does not name the domains, and `GET /api/auth/status` still only says `signUp`. Invitations and sign-in work as before, whatever the domain.
374
+ - `PROTOBASE_SIGN_UP_DOMAINS`, comma separated, replaces `domains` when set, so the deployment or the platform hosting the app decides them, and knows which it set. It only narrows open sign-up: without `signUp` in the config it turns nothing on.
375
+ - An empty list, from either, takes nobody: open sign-up is then off, as without `signUp`, never open to all. Without `domains` and the variable, every address may sign up.
376
+ - On the [GoTrue-compatible endpoints](#supabase-js-and-supabasessr), `POST /signup` from another address answers `422 signup_disabled`, and `POST /otp` sends a sign-in code, as with open sign-up off.
377
+ - On the host, `auth.signUpDomains` is the list in effect and `auth.signUpTakes(email)` whether open sign-up takes an address.
378
+ - <gap>A platform cannot read over HTTP the domains an app lists only in its own config because an endpoint that tells them to the platform is not implemented.</gap>
379
+
363
380
  ## Passkeys
364
381
 
365
382
  People add passkeys (Face ID, Touch ID, Windows Hello, a phone or a security key) on their account page, and sign in with "Sign in with a passkey". It is Better Auth's [passkey](https://www.better-auth.com/docs/plugins/passkey) plugin from `@better-auth/passkey`, under `/api/auth/passkey/*`.
@@ -380,9 +397,9 @@ On their account page, people turn on a second step after a password or an email
380
397
  - **Authenticator app:** the page shows a QR code (and the key, to type in), the person confirms it with a code from the app, and gets ten backup codes that each work once instead of a code. New backup codes replace the old ones.
381
398
  - **Emailed code:** with mail configured, a 6-digit code mailed at each sign-in, valid for 10 minutes. An account with an app can also choose an emailed code at sign-in. Backup codes come with the app only.
382
399
 
383
- Turning it on, off, or making new backup codes asks for the account's password when it has one. Without one, turning it on, reading the authenticator link (`/two-factor/get-totp-uri`) or making new backup codes from a session that signed in more than a day ago asks to [confirm it's them](#confirming-an-account-change) first, and the account page asks for it in place. At sign-in, a correct password or code answers `{ "twoFactorRedirect": true, "twoFactorMethods": ["totp", "otp"] }` instead of a session, and `POST /api/auth/two-factor/verify-totp`, `verify-otp` or `verify-backup-code` with `{ code, trustDevice? }` finishes it; `trustDevice` skips the step in that browser for 30 days. Ten wrong codes in a row lock the account's second step for 15 minutes.
400
+ Turning it on, off, or making new backup codes asks for the account's password when it has one. Without one, turning it on, reading the authenticator link (`/two-factor/get-totp-uri`) or making new backup codes from a session that signed in more than a day ago asks to [confirm it's them](#confirming-an-account-change) first, and the account page asks for it in place. At sign-in, a correct password or code, or a [sign-in token](#token-sign-in), answers `{ "twoFactorRedirect": true, "twoFactorMethods": ["totp", "otp"] }` instead of a session, and `POST /api/auth/two-factor/verify-totp`, `verify-otp` or `verify-backup-code` with `{ code, trustDevice? }` finishes it; `trustDevice` skips the step in that browser for 30 days. Ten wrong codes in a row lock the account's second step for 15 minutes.
384
401
 
385
- Sign-in with GitHub or another [provider](#sign-in-with-github) is not asked for the second step.
402
+ Sign-in with GitHub or another [provider](#sign-in-with-github) through its pages is not asked for the second step.
386
403
 
387
404
  ## Recent strong sign-in
388
405
 
@@ -443,7 +460,7 @@ The server stores the policy in the `sign_in_policy` table, one row per save (th
443
460
  - **Required:** someone who signs in without it is sent to set it up first. The server holds back API tokens until then (`GET /api/auth/token` answers `403`, `SIGN_IN_SETUP_REQUIRED`), and refuses to turn two-factor authentication off or to remove the last passkey.
444
461
  - Signed-in people keep their session after a change; a newly required method is asked for at their next token refresh, within 15 minutes.
445
462
  - **Staff sign-in as a person** shows only with an [operator provider](#operator-provider). Off refuses [staff sign-in](#staff-sign-in) (`403`, `SIGN_IN_METHOD_FORBIDDEN`); Email the person mails the person each time, and needs mail: without it the server refuses to save it, and a saved one turns staff sign-in off until mail is back.
446
- - **Sign in with ... through the platform** shows only with a [platform sign-in provider](#platform-sign-in-provider). Off refuses starting, finishing and connecting it (`403`, `SIGN_IN_METHOD_FORBIDDEN`) and the sign-in page leaves it out. It applies as Off while passkeys or two-factor authentication are Required: a provider's sign-in skips the app's second step, and the provider's own cannot be checked.
463
+ - **Sign in with ... through the platform** shows only with a [platform sign-in provider](#platform-sign-in-provider). Off refuses starting, finishing and connecting it, and its [token sign-in](#token-sign-in) (`403`, `SIGN_IN_METHOD_FORBIDDEN`), and the sign-in page leaves it out. It applies as Off while passkeys or two-factor authentication are Required: a provider's sign-in skips the app's second step, and the provider's own cannot be checked.
447
464
 
448
465
  The server refuses a policy (`400`, `SIGN_IN_POLICY_REFUSED`, with the reason) that would lock people out: passwords and emailed codes both off (someone without a passkey could not sign in), passwords off without mail, two-factor authentication required with passwords off (turning it on asks for the password), or a policy the saving admin could not sign in with. Emailed codes need mail: without `PROTOBASE_SMTP_URL` they are off whatever the policy says, and so that a policy saved with mail cannot lock everyone out once mail goes away, password sign-in is then on as well.
449
466
 
@@ -524,7 +541,7 @@ These work for every provider, the project's own and the [platform's](#platform-
524
541
  - **Connected accounts:** the [account page](#account-page)'s **Sign-in & security** tab lists the providers and offers "Connect GitHub" for one the account is not linked to. Connecting signs in at the provider and links that account whatever its address (`accountLinking.allowDifferentEmails`, which applies only to this explicit link by someone signed in). A provider account linked to another person already is refused (`account_already_linked_to_different_user`); a [staff session](#staff-sign-in) cannot link.
525
542
  - **Linked up front:** `protobase users create <email> --github-id <id>`, or `createUser(auth, { ..., accounts: [{ providerId: 'github', accountId }] })`, links a new user to a GitHub user id, so GitHub finds them by it whatever address it reports.
526
543
  - Without a link, a provider finds someone by address only when it vouches for the address (`email_verified`) and the account's address is verified; accounts created by an admin or on the host are.
527
- - **Through the provider's pages only:** signing in or connecting with an ID token a client posts instead (`idToken` on `/api/auth/sign-in/social` or `/api/auth/link-social`, as `signIn.social({ provider, idToken })` of Better Auth's client sends it) is refused with `403 TOKEN_SIGN_IN_OFF`, for every provider: such a token would sign in without the nonce of a sign-in the app started, as often as it is posted, and without the app's [second step](#two-factor-authentication).
544
+ - **Through the provider's pages only:** signing in or connecting with an ID token a client posts instead (`idToken` on `/api/auth/sign-in/social` or `/api/auth/link-social`, as `signIn.social({ provider, idToken })` of Better Auth's client sends it) is refused with `403 TOKEN_SIGN_IN_OFF`, for every provider: such a token would sign in without the nonce of a sign-in the app started, as often as it is posted, and without the app's [second step](#two-factor-authentication). The one exception is signing in with the platform's provider when its [token sign-in](#token-sign-in) is on, with the limits that section lists.
528
545
 
529
546
  ## Sign-in with SAML
530
547
 
@@ -572,13 +589,35 @@ Register the app with the provider as a confidential client with the redirect UR
572
589
  - **Startup:** the provider's settings are read when the app starts; when they cannot be, the provider is left out until the next start (the status and sign-in page do not offer it) and every other way to sign in works.
573
590
  - The [sign-in policy](#sign-in-policy) has a row for it, and `GET /api/auth/status` names it as `platformSignIn: { provider, name }` besides listing it in `socialProviders`.
574
591
 
575
- Set the first three together or none: some but not all of them stops the app at start with an error. In the config, `auth.signInProvider` takes the same settings and `scopes`, and `false` turns it off whatever the environment says:
592
+ Set the first three together or none: some but not all of them stops the app at start with an error. In the config, `auth.signInProvider` takes the same settings, `scopes` and `tokenSignIn`, and `false` turns it off whatever the environment says:
576
593
 
577
594
  ```ts
578
595
  auth: { signInProvider: { issuer, clientId, clientSecret, provider: 'oidc', name: 'Acme SSO', scopes: ['groups'] } }
579
596
  auth: { signInProvider: false }
580
597
  ```
581
598
 
599
+ ### Token sign-in
600
+
601
+ A client that already holds a fresh ID token the platform's provider issued for this app, such as a phone app the person signed in to once at the provider, can post it to the app instead of sending a browser through the provider's pages. It gets the app's own session, as an emailed code or the provider's pages would give it. The provider's token counts as one factor, in the place of an emailed code: the app asks for its own second step when the person turned one on, and nothing else. Off by default:
602
+
603
+ ```sh
604
+ PROTOBASE_SIGN_IN_TOKENS=true # true or false; anything else stops the app at start
605
+ ```
606
+
607
+ ```ts
608
+ auth: { signInProvider: { issuer, clientId, clientSecret, tokenSignIn: true } }
609
+ ```
610
+
611
+ The client posts `POST /api/auth/sign-in/social` with `{ "provider": "<provider id>", "idToken": { "token": "<ID token>" } }`, as Better Auth's client sends `signIn.social({ provider, idToken: { token } })`, and gets the session cookie with `{ redirect: false, user }`, or `{ twoFactorRedirect: true, twoFactorMethods }` when the [second step](#two-factor-authentication) is due, which it finishes as after a password. Then `GET /api/auth/token` gives it the app's API token as for any session.
612
+
613
+ - **Only this app's own provider:** the app trusts the one provider it is configured with, and a token only for this app. The token must be signed with a key the provider publishes (its discovery's `jwks_uri`) with an asymmetric algorithm, come from the configured issuer, and have this app's client id as its one audience, so a token issued for another app is never accepted here. It must carry a `jti` and an `email`, live at most 5 minutes from `iat` to `exp`, and have been issued within the last 5 minutes (30 seconds of clock skew allowed). Otherwise it is refused with `401 INVALID_TOKEN`.
614
+ - **Once:** each token signs in once. Its `jti` is kept in the `verification` table until it expires, with no migration, and a second use answers `401 TOKEN_USED`.
615
+ - **Who it signs in:** as through the provider's pages, the account linked to the provider's `sub`, else the account with the address the provider vouches for (`email_verified`), which it links. Nobody is signed up (`401`), and a banned person is refused.
616
+ - **Never recent:** the client can mint a fresh session at will, so a session a token began never counts as [recently signed in](#confirming-an-account-change). Adding a passkey, unlinking a provider, making a personal access token or deleting the account asks it to confirm it's them in place first, and it is never a [strong sign-in](#recent-strong-sign-in) until it confirms it's them.
617
+ - **The policy:** **Sign in with ... through the platform** in the [sign-in policy](#sign-in-policy) covers it, so Off refuses it, and so do passkeys or two-factor authentication being Required. Linking a provider with a token stays refused (`403 TOKEN_SIGN_IN_OFF`).
618
+ - **Rate limit:** `/api/auth/sign-in/social` takes `signInPerMinute` requests a minute per client, default 5, as a password sign-in does.
619
+ - **Signing out:** signing out at the provider ends no session in the app, as with the provider's pages; the app's own sign-out, an admin, a ban or a deletion does.
620
+
582
621
  ### Self-hosting with Dex or Keycloak
583
622
 
584
623
  [Dex](https://dexidp.io) with its GitHub connector signs people in with GitHub through one GitHub OAuth app for every app, the way Protobase Cloud does:
@@ -439,7 +439,7 @@ Serves the API of a bundle from `protobase build` and owns the process around it
439
439
  | `PROTOBASE_SMTP_URL` | the SMTP server for password-reset mail, emailed sign-in and two-factor codes and the app's own [email](email.md), credential included: `smtp://user:password@host:587` (STARTTLS required, `?requireTLS=false` sends in plaintext, see [Email](email.md#configuration)) or `smtps://...:465`; without it they are off ([Password reset](auth.md#password-reset), [Emailed sign-in codes](auth.md#emailed-sign-in-codes)) |
440
440
  | `PROTOBASE_MAIL_FROM` | the sender of that mail, a plain address such as `noreply@admin.example.com`; set with `PROTOBASE_SMTP_URL` or not at all |
441
441
  | `PROTOBASE_APP_NAME` | the app's name, such as `Property Finder`: what its auth emails, its sidebar, its browser tabs and the [installed app](installable-app.md) call it, and the sender's display name of its mail, over the config's [`name`](config/app.md#name) |
442
- | `PROTOBASE_SIGN_IN_ISSUER`, `PROTOBASE_SIGN_IN_CLIENT_ID`, `PROTOBASE_SIGN_IN_CLIENT_SECRET` | an OpenID Connect provider people who have an account can sign in with; all three or none. `PROTOBASE_SIGN_IN_PROVIDER` and `PROTOBASE_SIGN_IN_NAME` are optional ([Platform sign-in provider](auth.md#platform-sign-in-provider)) |
442
+ | `PROTOBASE_SIGN_IN_ISSUER`, `PROTOBASE_SIGN_IN_CLIENT_ID`, `PROTOBASE_SIGN_IN_CLIENT_SECRET` | an OpenID Connect provider people who have an account can sign in with; all three or none. `PROTOBASE_SIGN_IN_PROVIDER` and `PROTOBASE_SIGN_IN_NAME` are optional, and `PROTOBASE_SIGN_IN_TOKENS=true` turns on [token sign-in](auth.md#token-sign-in) ([Platform sign-in provider](auth.md#platform-sign-in-provider)) |
443
443
  | `PROTOBASE_OPERATOR_ISSUER`, `PROTOBASE_OPERATOR_CLIENT_ID`, `PROTOBASE_OPERATOR_CLIENT_SECRET` | the OpenID Connect provider of the operator's staff, for [staff sign-in](auth.md#staff-sign-in) as people of the app; all three or none. `PROTOBASE_OPERATOR_NAME` and `PROTOBASE_OPERATOR_GROUP` are optional ([Operator provider](auth.md#operator-provider)) |
444
444
  | `PROTOBASE_ORIGINS`, `PROTOBASE_PASSKEY_DOMAIN` | the other origins the app is served on, comma separated, and the host new passkeys are made for ([Several origins](auth.md#several-origins)) |
445
445
  | `PROTOBASE_CORS_ORIGINS` | other websites whose browser code may call the API, `*` or comma separated http and https origins ([CORS](api.md#cors)) |
@@ -61,10 +61,10 @@ export default defineConfig({ auth: { organizations: { create: 'everyone', invit
61
61
 
62
62
  ## auth.signUp
63
63
 
64
- - **Type:** `{ role: string }`
64
+ - **Type:** `{ role: string; domains?: string[] }`
65
65
  - **Default:** off
66
66
 
67
- Open sign-up: anyone makes their own account from the sign-in page, with `role`, after proving their address with an emailed code. Needs a mailer. `role` is one of [`roles`](#authroles) and never `admin`. Not with organizations. See [Open sign-up](../auth.md#open-sign-up).
67
+ Open sign-up: anyone makes their own account from the sign-in page, with `role`, after proving their address with an emailed code. Needs a mailer. `role` is one of [`roles`](#authroles) and never `admin`. `domains` takes only addresses at those email domains, subdomains included, and `PROTOBASE_SIGN_UP_DOMAINS` replaces it; an empty list leaves sign-up off. Not with organizations. See [Open sign-up](../auth.md#open-sign-up) and [Sign-up for email domains](../auth.md#sign-up-for-email-domains).
68
68
 
69
69
  ```ts
70
70
  export default defineConfig({ auth: { roles: ['admin', 'customer'], signUp: { role: 'customer' } } })
@@ -167,11 +167,11 @@ export default defineConfig(({ env }) => ({
167
167
 
168
168
  ## auth.signInProvider
169
169
 
170
- - **Type:** `{ issuer: string; clientId: string; clientSecret: string; provider?: string; name?: string; scopes?: string[] } | false`
170
+ - **Type:** `{ issuer: string; clientId: string; clientSecret: string; provider?: string; name?: string; scopes?: string[]; tokenSignIn?: boolean } | false`
171
171
  - **Default:** the provider of the environment variables below, when set
172
- - **Environment variables:** `PROTOBASE_SIGN_IN_ISSUER`, `PROTOBASE_SIGN_IN_CLIENT_ID`, `PROTOBASE_SIGN_IN_CLIENT_SECRET`, and optionally `PROTOBASE_SIGN_IN_PROVIDER` and `PROTOBASE_SIGN_IN_NAME`
172
+ - **Environment variables:** `PROTOBASE_SIGN_IN_ISSUER`, `PROTOBASE_SIGN_IN_CLIENT_ID`, `PROTOBASE_SIGN_IN_CLIENT_SECRET`, and optionally `PROTOBASE_SIGN_IN_PROVIDER`, `PROTOBASE_SIGN_IN_NAME` and `PROTOBASE_SIGN_IN_TOKENS` (`true` or `false`)
173
173
 
174
- An OpenID Connect provider the platform adds for people who already have an account; it never signs anyone up. `provider` is its id (default `oidc`), `name` its button's name. `false` turns it off whatever the environment says. Left out when `socialProviders` has a provider with the same id. See [Platform sign-in provider](../auth.md#platform-sign-in-provider).
174
+ An OpenID Connect provider the platform adds for people who already have an account; it never signs anyone up. `provider` is its id (default `oidc`), `name` its button's name, and `tokenSignIn: true` lets a client sign in with a fresh ID token the provider issued for this app ([Token sign-in](../auth.md#token-sign-in), default off). `false` turns it off whatever the environment says. Left out when `socialProviders` has a provider with the same id. See [Platform sign-in provider](../auth.md#platform-sign-in-provider).
175
175
 
176
176
  ```ts
177
177
  export default defineConfig({ auth: { signInProvider: false } })