You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One line summary of the issue here.
When checking the new access token provided by requestAccessToken, isAccessTokenExpired always returns true
Expected behavior
Token should not be expired
As concisely as possible, describe the expected behavior.
requestAccessToken returns a new token with expiry time. Local checks pass for the expiry time should also pass with api call
Actual behavior
always returns true
As concisely as possible, describe the observed behavior.
Steps to reproduce the behavior
generate auth link
in call back request a new access token
check if the token is expired
Please list all relevant steps to reproduce the observed behavior.
const clientT = new auth.OAuth2User({ client_id: process.env.TWITTER_CLIENT_ID as string, client_secret: process.env.TWITTER_CLIENT_SECRET as string, callback: process.env.TWITTER_OAUTH_CALLBACK_URL as string, scopes: ["tweet.read", "tweet.write", "users.read", "offline.access"], token: { refresh_token: refreshToken, token_type: "refresh_token", }, });
One line summary of the issue here.
When checking the new access token provided by requestAccessToken, isAccessTokenExpired always returns true
Expected behavior
Token should not be expired
As concisely as possible, describe the expected behavior.
requestAccessToken returns a new token with expiry time. Local checks pass for the expiry time should also pass with api call
Actual behavior
always returns true
As concisely as possible, describe the observed behavior.
Steps to reproduce the behavior
generate auth link
in call back request a new access token
check if the token is expired
Please list all relevant steps to reproduce the observed behavior.
const clientT = new auth.OAuth2User({
client_id: process.env.TWITTER_CLIENT_ID as string,
client_secret: process.env.TWITTER_CLIENT_SECRET as string,
callback: process.env.TWITTER_OAUTH_CALLBACK_URL as string,
scopes: ["tweet.read", "tweet.write", "users.read", "offline.access"],
token: {
refresh_token: refreshToken,
token_type: "refresh_token",
},
});
const isExpired = clientT.isAccessTokenExpired();
if (isExpired.valueOf()) {
logger.log("Token is expired");
const newToken = await clientT.refreshAccessToken();
logger.log("New Token: " + JSON.stringify(newToken));
}
The text was updated successfully, but these errors were encountered: