@vercel/connect 0.0.4-alpha.7 → 0.0.4-alpha.8
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.
package/README.md
CHANGED
|
@@ -313,7 +313,7 @@ export const auth = betterAuth({
|
|
|
313
313
|
| -------------------- | ----------------------- | ----------------------------------------------------------------------------------------------------- |
|
|
314
314
|
| `id` | `string` | Provider id used by Better Auth's generic OAuth plugin. Surfaces in the sign-in URL and account rows. |
|
|
315
315
|
| `connector` | `string` | Vercel Connect connector identifier — accepts `scl_...` or the human-readable UID. |
|
|
316
|
-
| `scopes` | `readonly string[]` | Scopes to request. `offline_access` is added automatically. Defaults to `["
|
|
316
|
+
| `scopes` | `readonly string[]` | Scopes to request. `offline_access` is added automatically. Defaults to `["openid"]`. |
|
|
317
317
|
| `getVercelOidcToken` | `() => Promise<string>` | Override the OIDC token fetcher. Defaults to `getVercelOidcToken` from `@vercel/oidc`. |
|
|
318
318
|
|
|
319
319
|
When the OIDC token is readable, the helper scopes the Vercel Connect consent UI to the deployment's Vercel team (`?teamId=...` on the authorization URL); outside Vercel it falls back to the unqualified URL.
|
|
@@ -354,7 +354,7 @@ export const authConfig: AuthConfig = {
|
|
|
354
354
|
| `id` | `string` | Provider id surfaced by Auth.js. Becomes the path segment in callback URLs and the `provider` field on accounts. |
|
|
355
355
|
| `name` | `string` | Human-readable display name used by Auth.js sign-in UIs. |
|
|
356
356
|
| `connector` | `string` | Vercel Connect connector identifier — accepts `scl_...` or the human-readable UID. |
|
|
357
|
-
| `scopes` | `readonly string[]` | Scopes to request. `offline_access` is added automatically. Defaults to `["
|
|
357
|
+
| `scopes` | `readonly string[]` | Scopes to request. `offline_access` is added automatically. Defaults to `["openid"]`. |
|
|
358
358
|
| `getVercelOidcToken` | `() => Promise<string>` | Override the OIDC token fetcher. Defaults to `getVercelOidcToken` from `@vercel/oidc`. |
|
|
359
359
|
|
|
360
360
|
#### `ConnectProfile`
|
|
@@ -26,7 +26,7 @@ export interface AuthJsConnectOptions {
|
|
|
26
26
|
/**
|
|
27
27
|
* Scopes to request. `offline_access` is added automatically so
|
|
28
28
|
* the Vercel Connect side can mint refresh tokens. Defaults to
|
|
29
|
-
* `["
|
|
29
|
+
* `["openid"]`.
|
|
30
30
|
*/
|
|
31
31
|
readonly scopes?: readonly string[];
|
|
32
32
|
/**
|
|
@@ -35,7 +35,7 @@ const CONNECT_USERINFO_URL = "https://connect.vercel.com/oauth/userinfo";
|
|
|
35
35
|
*/
|
|
36
36
|
export function connect(options) {
|
|
37
37
|
const fetchVercelToken = options.getVercelOidcToken ?? getVercelOidcToken;
|
|
38
|
-
const scope = Array.from(new Set([...(options.scopes ?? ["
|
|
38
|
+
const scope = Array.from(new Set([...(options.scopes ?? ["openid"]), "offline_access"])).join(" ");
|
|
39
39
|
return {
|
|
40
40
|
id: options.id,
|
|
41
41
|
name: options.name,
|
|
@@ -15,7 +15,7 @@ export interface BetterAuthConnectOptions {
|
|
|
15
15
|
readonly connector: string;
|
|
16
16
|
/**
|
|
17
17
|
* Scopes to request. `offline_access` is added automatically so the
|
|
18
|
-
* Vercel Connect side can mint refresh tokens. Defaults to `["
|
|
18
|
+
* Vercel Connect side can mint refresh tokens. Defaults to `["openid"]`.
|
|
19
19
|
*/
|
|
20
20
|
readonly scopes?: readonly string[];
|
|
21
21
|
/**
|
|
@@ -39,7 +39,7 @@ const CONNECT_USERINFO_URL = "https://connect.vercel.com/oauth/userinfo";
|
|
|
39
39
|
*/
|
|
40
40
|
export function connect(options) {
|
|
41
41
|
const fetchVercelToken = options.getVercelOidcToken ?? getVercelOidcToken;
|
|
42
|
-
const scopes = Array.from(new Set([...(options.scopes ?? ["
|
|
42
|
+
const scopes = Array.from(new Set([...(options.scopes ?? ["openid"]), "offline_access"]));
|
|
43
43
|
return {
|
|
44
44
|
providerId: options.providerId,
|
|
45
45
|
clientId: options.connector,
|