-
Notifications
You must be signed in to change notification settings - Fork 924
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(refresh scheme): fix non-required refresh token flow (#715)
Set refresh token to `true` instead of `false` if refresh token is not required. That way refresh token expiration is set. And add `isRefreshing` and `updateOnRefresh` params to be able to not update refresh token expiration if refresh endpoint doesn't refresh the refresh token. Also simplify `check` as refresh token will always be `true` when not required. Add custom scheme for Laravel JWT provider to not update refresh token expiration on refresh.
- Loading branch information
1 parent
7c11ee9
commit 0948291
Showing
3 changed files
with
18 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import RefreshScheme from '../../../schemes/refresh' | ||
|
||
export default class LaravelJWT extends RefreshScheme { | ||
_updateTokens (response, { isRefreshing = false, updateOnRefresh = false } = {}) { | ||
super._updateTokens(response, { isRefreshing, updateOnRefresh }) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters