Skip to content

Commit c3f59d6

Browse files
Merge pull request #271 from pilcrowonpaper/next
Release v3.2.3
2 parents 46b1607 + a7cdcae commit c3f59d6

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

.RELEASE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Figma: Update endpoints to latest ([#267](https://github.com/pilcrowonpaper/arctic/pull/267)).
2+
- Entra ID: Remove `Origin` header for confidential clients ([#270](https://github.com/pilcrowonpaper/arctic/pull/270)).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "arctic",
33
"type": "module",
4-
"version": "3.2.2",
4+
"version": "3.2.3",
55
"description": "OAuth 2.0 clients for popular providers",
66
"main": "dist/index.js",
77
"types": "dist/index.d.ts",

src/providers/figma.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { OAuth2Client } from "../client.js";
33
import type { OAuth2Tokens } from "../oauth2.js";
44

55
const authorizationEndpoint = "https://www.figma.com/oauth";
6-
const tokenEndpoint = "https://www.figma.com/api/oauth/token";
6+
const tokenEndpoint = "https://api.figma.com/v1/oauth/token";
77
const refreshEndpoint = "https://api.figma.com/v1/oauth/refresh";
88

99
export class Figma {

src/providers/microsoft-entra-id.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ export class MicrosoftEntraId {
5959
body.set("client_id", this.clientId);
6060
}
6161
const request = createOAuth2Request(this.tokenEndpoint, body);
62-
// Origin header required for public clients. Value can be anything.
63-
request.headers.set("Origin", "arctic");
6462
if (this.clientSecret !== null) {
6563
const encodedCredentials = encodeBasicCredentials(this.clientId, this.clientId);
6664
request.headers.set("Authorization", `Basic ${encodedCredentials}`);
65+
} else {
66+
// Origin header required for public clients. Must not be defined for confidential clients.
67+
// Value can be anything.
68+
request.headers.set("Origin", "arctic");
6769
}
6870
const tokens = await sendTokenRequest(request);
6971
return tokens;
@@ -80,11 +82,13 @@ export class MicrosoftEntraId {
8082
body.set("scope", scopes.join(" "));
8183
}
8284
const request = createOAuth2Request(this.tokenEndpoint, body);
83-
// Origin header required for public clients. Value can be anything.
84-
request.headers.set("Origin", "arctic");
8585
if (this.clientSecret !== null) {
8686
const encodedCredentials = encodeBasicCredentials(this.clientId, this.clientSecret);
8787
request.headers.set("Authorization", `Basic ${encodedCredentials}`);
88+
} else {
89+
// Origin header required for public clients. Must not be defined for confidential clients.
90+
// Value can be anything.
91+
request.headers.set("Origin", "arctic");
8892
}
8993
const tokens = await sendTokenRequest(request);
9094
return tokens;

0 commit comments

Comments
 (0)