Skip to content

Commit

Permalink
Release v3.2.1 (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowonpaper authored Jan 22, 2025
1 parent 594e1f6 commit 6b6c059
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Add `refreshAccessToken()` method to Figma provider ([#258](https://github.com/pilcrowonpaper/arctic/pull/258)).
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "arctic",
"type": "module",
"version": "3.2.0",
"version": "3.2.1",
"description": "OAuth 2.0 clients for popular providers",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
6 changes: 6 additions & 0 deletions src/providers/figma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { OAuth2Tokens } from "../oauth2.js";

const authorizationEndpoint = "https://www.figma.com/oauth";
const tokenEndpoint = "https://www.figma.com/api/oauth/token";
const refreshEndpoint = "https://api.figma.com/v1/oauth/refresh";

export class Figma {
private client: OAuth2Client;
Expand All @@ -21,4 +22,9 @@ export class Figma {
const tokens = await this.client.validateAuthorizationCode(tokenEndpoint, code, null);
return tokens;
}

public async refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens> {
const tokens = await this.client.refreshAccessToken(refreshEndpoint, refreshToken, []);
return tokens;
}
}

0 comments on commit 6b6c059

Please sign in to comment.