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

Allow force refreshing of the access token #147

Merged
merged 1 commit into from Aug 19, 2020
Merged

Allow force refreshing of the access token #147

merged 1 commit into from Aug 19, 2020

Conversation

ghost
Copy link

@ghost ghost commented Jul 21, 2020

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

The purpose of this pr is to allow the access token to be refreshed manually

Provide details that support your chosen implementation, including: breaking changes, alternatives considered, changes to the API, etc.
Changes are to AccessTokenRequest interface to allow the option refresh which is not required.
and inside of getAccessToken() where it would check if the token was expired and there is a refresh token it now also checks
(session.refreshToken && accessTokenRequest && accessTokenRequest.refresh

How it can be used is getAccessToken({refresh:true})

References

Include any links supporting this change such as a:

Testing

Describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.
Added a new test for this outcome next with the same code with a change to the time that is used to test the expired access token

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not master

@sandrinodimattia sandrinodimattia merged commit ddf7ba7 into auth0:master Aug 19, 2020
@sandrinodimattia
Copy link
Member

Thank you! This is now available in v0.16 👍

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.

1 participant