Skip to content

Commit b972380

Browse files
authored
Include refreshToken in Verify (#32)
* Added refreshToken to verify AS A trusted store I WANT a refreshToken SO THAT I can continue working by refreshing the accessToken beyond the 2hr expiry window * Added refreshToken to verify AS A trusted store I WANT a refreshToken SO THAT I can continue working by refreshing the accessToken beyond the 2hr expiry window
1 parent 236d651 commit b972380

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Twitter2Strategy.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export interface Twitter2StrategyOptions {
2323

2424
export interface Twitter2StrategyVerifyParams {
2525
accessToken: string;
26+
refreshToken: string;
2627
expiresIn: number;
2728
scope: string;
2829
context?: AppLoadContext;
@@ -178,12 +179,13 @@ export class Twitter2Strategy<User> extends Strategy<
178179
}
179180
const body = await response.json();
180181
debug("access token " + JSON.stringify(body));
181-
const { expires_in, access_token, scope } = body;
182+
const { expires_in, access_token, scope, refresh_token } = body;
182183

183184
// Verify the user and return it, or redirect
184185
try {
185186
user = await this.verify({
186187
accessToken: access_token,
188+
refreshToken: refresh_token,
187189
expiresIn: expires_in,
188190
scope,
189191
context: options.context,

0 commit comments

Comments
 (0)