Comparing version 3.2.2 to 3.2.3
import { OAuth2Client } from "../client.js"; | ||
const authorizationEndpoint = "https://www.figma.com/oauth"; | ||
const tokenEndpoint = "https://www.figma.com/api/oauth/token"; | ||
const tokenEndpoint = "https://api.figma.com/v1/oauth/token"; | ||
const refreshEndpoint = "https://api.figma.com/v1/oauth/refresh"; | ||
@@ -5,0 +5,0 @@ export class Figma { |
@@ -40,4 +40,2 @@ import { createS256CodeChallenge } from "../oauth2.js"; | ||
const request = createOAuth2Request(this.tokenEndpoint, body); | ||
// Origin header required for public clients. Value can be anything. | ||
request.headers.set("Origin", "arctic"); | ||
if (this.clientSecret !== null) { | ||
@@ -47,2 +45,7 @@ const encodedCredentials = encodeBasicCredentials(this.clientId, this.clientId); | ||
} | ||
else { | ||
// Origin header required for public clients. Must not be defined for confidential clients. | ||
// Value can be anything. | ||
request.headers.set("Origin", "arctic"); | ||
} | ||
const tokens = await sendTokenRequest(request); | ||
@@ -62,4 +65,2 @@ return tokens; | ||
const request = createOAuth2Request(this.tokenEndpoint, body); | ||
// Origin header required for public clients. Value can be anything. | ||
request.headers.set("Origin", "arctic"); | ||
if (this.clientSecret !== null) { | ||
@@ -69,2 +70,7 @@ const encodedCredentials = encodeBasicCredentials(this.clientId, this.clientSecret); | ||
} | ||
else { | ||
// Origin header required for public clients. Must not be defined for confidential clients. | ||
// Value can be anything. | ||
request.headers.set("Origin", "arctic"); | ||
} | ||
const tokens = await sendTokenRequest(request); | ||
@@ -71,0 +77,0 @@ return tokens; |
{ | ||
"name": "arctic", | ||
"type": "module", | ||
"version": "3.2.2", | ||
"version": "3.2.3", | ||
"description": "OAuth 2.0 clients for popular providers", | ||
@@ -6,0 +6,0 @@ "main": "dist/index.js", |
131586
3034