Skip to content

Commit 8ecebda

Browse files
authored
Use refresh tokens (#97)
1 parent d804d82 commit 8ecebda

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "linear-zapier",
3-
"version": "4.8.6",
3+
"version": "4.9.0",
44
"description": "Linear's Zapier integration",
55
"main": "index.js",
66
"license": "MIT",

src/authentication.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,22 @@ export const authentication = {
8181
"Content-Type": "application/x-www-form-urlencoded",
8282
},
8383
},
84+
// Zapier will automatically refresh the access token when it expires
85+
refreshAccessToken: {
86+
method: "POST",
87+
url: "https://api.linear.app/oauth/token",
88+
body: {
89+
refresh_token: "{{bundle.authData.refresh_token}}",
90+
client_id: "{{process.env.CLIENT_ID}}",
91+
client_secret: "{{process.env.CLIENT_SECRET}}",
92+
grant_type: "refresh_token",
93+
},
94+
headers: {
95+
"Content-Type": "application/x-www-form-urlencoded",
96+
},
97+
},
98+
// Enable automatic token refresh on 401 errors
99+
autoRefresh: true,
84100
scope: "read,write",
85101
},
86102

0 commit comments

Comments
 (0)