@rebasepro/server 0.29.3 → 0.30.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.
@@ -293,19 +293,23 @@ export interface RebaseAuthConfig {
293
293
  */
294
294
  emailOtp?: boolean;
295
295
  /**
296
- * Opt-in httpOnly cookie mode for refresh tokens.
296
+ * Where the refresh token is handed to a browser. On by default, as the
297
+ * runtime has it.
297
298
  *
298
- * When set, the refresh token is delivered as an `httpOnly`, `Secure`,
299
- * `SameSite` cookie instead of in the JSON response body. This
300
- * prevents XSS from stealing the long-lived refresh token.
299
+ * The refresh token is delivered as an `httpOnly`, `Secure`, `SameSite=Lax`
300
+ * cookie instead of in the JSON response body, out of reach of XSS. The
301
+ * access token remains in the body for `Authorization: Bearer` headers. A
302
+ * browser `@rebasepro/client` defaults to this flow; a client without a
303
+ * cookie jar sends `x-rebase-auth-flow: json` and is answered in the body.
301
304
  *
302
- * The access token remains in the JSON body so the client can use it
303
- * in `Authorization: Bearer` headers for API calls.
305
+ * Pass an object to change the cookie's name, path, domain, `SameSite` or
306
+ * `Secure`. Pass `false` to answer every client in the body, as a server
307
+ * without cookies does; a browser client then needs `authFlowMode: "json"`.
304
308
  *
305
- * **Requires** `credentials: "include"` on client-side fetch calls to
306
- * auth endpoints, and CORS must allow credentials (no `origin: "*"`).
309
+ * A browser app on another origin needs CORS that allows credentials (no
310
+ * `origin: "*"`).
307
311
  */
308
- cookieAuth?: import("../auth/index.js").CookieAuthConfig;
312
+ cookieAuth?: import("../auth/index.js").CookieAuthConfig | false;
309
313
  /**
310
314
  * Refuse password sign-in until the account's email address is verified,
311
315
  * and make registration confirm-first. Off by default.