Skip to content

Commit 6b6c059

Browse files
Release v3.2.1 (#259)
1 parent 594e1f6 commit 6b6c059

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.RELEASE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Add `refreshAccessToken()` method to Figma provider ([#258](https://github.com/pilcrowonpaper/arctic/pull/258)).

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.0",
4+
"version": "3.2.1",
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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { OAuth2Tokens } from "../oauth2.js";
44

55
const authorizationEndpoint = "https://www.figma.com/oauth";
66
const tokenEndpoint = "https://www.figma.com/api/oauth/token";
7+
const refreshEndpoint = "https://api.figma.com/v1/oauth/refresh";
78

89
export class Figma {
910
private client: OAuth2Client;
@@ -21,4 +22,9 @@ export class Figma {
2122
const tokens = await this.client.validateAuthorizationCode(tokenEndpoint, code, null);
2223
return tokens;
2324
}
25+
26+
public async refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens> {
27+
const tokens = await this.client.refreshAccessToken(refreshEndpoint, refreshToken, []);
28+
return tokens;
29+
}
2430
}

0 commit comments

Comments
 (0)