diff --git a/.RELEASE.md b/.RELEASE.md new file mode 100644 index 00000000..5de64295 --- /dev/null +++ b/.RELEASE.md @@ -0,0 +1 @@ +- Add `refreshAccessToken()` method to Figma provider ([#258](https://github.com/pilcrowonpaper/arctic/pull/258)). diff --git a/package.json b/package.json index f787f0df..80bba8ae 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/providers/figma.ts b/src/providers/figma.ts index 119be4e6..6a103472 100644 --- a/src/providers/figma.ts +++ b/src/providers/figma.ts @@ -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; @@ -21,4 +22,9 @@ export class Figma { const tokens = await this.client.validateAuthorizationCode(tokenEndpoint, code, null); return tokens; } + + public async refreshAccessToken(refreshToken: string): Promise { + const tokens = await this.client.refreshAccessToken(refreshEndpoint, refreshToken, []); + return tokens; + } }