@vercel/connect 0.0.4-alpha.4 → 0.0.4-alpha.6
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.
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
import { customFetch } from "@auth/core";
|
|
27
27
|
import { getVercelOidcToken } from "@vercel/oidc";
|
|
28
28
|
import { tryGetVercelTeamId, withTeamId } from "../internal/team-id.js";
|
|
29
|
-
const CONNECT_AUTHORIZATION_URL = "https://vercel.com/
|
|
30
|
-
const CONNECT_TOKEN_URL = "https://vercel.com/
|
|
31
|
-
const CONNECT_USERINFO_URL = "https://vercel.com/
|
|
29
|
+
const CONNECT_AUTHORIZATION_URL = "https://connect.vercel.com/oauth/authorize";
|
|
30
|
+
const CONNECT_TOKEN_URL = "https://connect.vercel.com/oauth/token";
|
|
31
|
+
const CONNECT_USERINFO_URL = "https://connect.vercel.com/oauth/userinfo";
|
|
32
32
|
/**
|
|
33
33
|
* Builds an Auth.js `OAuth2Config` for Vercel Connect. Push the
|
|
34
34
|
* result into `AuthConfig.providers`.
|
package/dist/authorization.js
CHANGED
|
@@ -10,7 +10,7 @@ export async function startAuthorization(connector, params, options) {
|
|
|
10
10
|
validateWebhookUrl(options.webhook);
|
|
11
11
|
}
|
|
12
12
|
const vercelToken = options?.vercelToken ?? (await getVercelOidcToken());
|
|
13
|
-
const endpoint = `https://api.vercel.com/v1/
|
|
13
|
+
const endpoint = `https://api.vercel.com/v1/connect/authorize/${encodeURIComponent(connector)}`;
|
|
14
14
|
const body = {
|
|
15
15
|
...params,
|
|
16
16
|
...(options?.callbackUrl !== undefined && {
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
import { getVercelOidcToken } from "@vercel/oidc";
|
|
31
31
|
import { getOAuth2Tokens } from "better-auth/oauth2";
|
|
32
32
|
import { tryGetVercelTeamId, withTeamId } from "../internal/team-id.js";
|
|
33
|
-
const CONNECT_AUTHORIZATION_URL = "https://vercel.com/
|
|
34
|
-
const CONNECT_TOKEN_URL = "https://vercel.com/
|
|
35
|
-
const CONNECT_USERINFO_URL = "https://vercel.com/
|
|
33
|
+
const CONNECT_AUTHORIZATION_URL = "https://connect.vercel.com/oauth/authorize";
|
|
34
|
+
const CONNECT_TOKEN_URL = "https://connect.vercel.com/oauth/token";
|
|
35
|
+
const CONNECT_USERINFO_URL = "https://connect.vercel.com/oauth/userinfo";
|
|
36
36
|
/**
|
|
37
37
|
* Builds a `GenericOAuthConfig` entry for Vercel Connect. Pass the
|
|
38
38
|
* result into `genericOAuth({ config: [...] })`.
|
package/dist/internal/team-id.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Best-effort Vercel team-id extraction for the OAuth adapters.
|
|
3
3
|
*
|
|
4
|
-
* Vercel Connect's `/
|
|
4
|
+
* Vercel Connect's `/oauth/authorize` endpoint accepts an
|
|
5
5
|
* optional `?teamId=...` query parameter that scopes the consent UI
|
|
6
6
|
* to a specific team. The team id lives inside the Vercel OIDC
|
|
7
7
|
* token's `owner_id` claim, so we decode the JWT payload (no
|
package/dist/token.js
CHANGED
|
@@ -34,7 +34,7 @@ export async function getTokenResponse(connector, params, options) {
|
|
|
34
34
|
cache.delete(cacheKey);
|
|
35
35
|
}
|
|
36
36
|
const vercelToken = options?.vercelToken ?? (await getVercelOidcToken());
|
|
37
|
-
const endpoint = `https://api.vercel.com/v1/
|
|
37
|
+
const endpoint = `https://api.vercel.com/v1/connect/token/${encodeURIComponent(connector)}`;
|
|
38
38
|
const response = await fetch(endpoint, {
|
|
39
39
|
method: "POST",
|
|
40
40
|
headers: {
|