Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clears refreshToken from storage when expired #1222

Closed
wants to merge 5 commits into from

Conversation

jaredperreault-okta
Copy link
Contributor

No description provided.


export function isRefreshTokenExpiredError(error: Error) {
// error: {"error":"invalid_grant","error_description":"The refresh token is invalid or expired."}
if (error.name !== 'OAuthError') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could save a few lines here and have a reusable way of filtering errors and avoiding typecasting by using a type guard function: https://www.typescriptlang.org/docs/handbook/advanced-types.html#user-defined-type-guards

https://github.com/okta/okta-auth-js/blob/master/lib/errors/index.ts#L19

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR updated

eng-prod-CI-bot-okta pushed a commit that referenced this pull request Jun 1, 2022
OKTA-495545
<<<Jenkins Check-In of Tested SHA: 20376d9 for [email protected]>>>
Artifact: okta-auth-js
Files changed count: 9
PR Link: #1222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants