-
Notifications
You must be signed in to change notification settings - Fork 930
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
feat(local): add refresh token #325
Conversation
…et default refresh endpoint
…1 because of the token refresh
Thanks, Will this work if I get 2 tokens from successful Also, are I can often have authentication responses like: {
"data": {
"access_token": "...",
"expires_in": 3600,
"refresh_token": "...",
"token_type": "Bearer"
}
} |
@ryanwinchester Yes, the properties are customizable. I've used the name
|
Hi @ryanwinchester, I think I forgot to mention for you to use the develop branch of my fork. Sorry! |
Nevermind. You can use dev branch, I merged. |
…esh token in the constructor.
…e sure that remember overwrite default expiration
refactor(refresh token): add refresh scheme
Hey guys! We have been refactoring the refresh system, and now it has its own scheme. We also moved the endpoint options to scheme. Please, check the updated docs in the top of the page! |
Hey guys! We are now working on another branch and PR. Check it out here #361 We have been improving and refactoring the refresh scheme, so check the new docs at the new PR before update! The major improvement is the interceptor. Now we intercept the requests instead of the errors. That way we check if the token has expired before send the request and if so, it refreshes the token. So no more 401 errors! I'm also keeping the branch up to date with the latest releases! If you guys have any doubt or wanna report an error, just contact me! Note: This branch will not be updated anymore. Please, use the new one! |
Closing here as work continues on #361 |
Hi!
First of all, I would like to thank you for this awesome package! It really helps a lot!
I also would like to thank @KonoMaxi for his refresh token system #208, I used it as base to make this one.
So, this PR will add refresh token system to local strategy.
Features:
Usage
Set
_scheme: 'refresh'
and configure refresh endpoint in local strategy.Example:
Note: You don't need to specify each property as listed in example, as they have default values. List of default values below. Also, don't worry about the dots! If you set the property like
data.refresh_token
, it will automatically use the name after the dot in the payload!Default values
Bug or Suggestion
If you've found any bug or want a new functionality related to this, just make a comment and tag me!