-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nil check in refreshHandler + refreshHandler code refactoring (#165)
1) added a nil check in refreshHandler to prevent panic when token is nil, this is when there is no JWT in cookie 2) refactored code to new RefreshToken func, for ppl who like to refresh everytime in Authorization or every request 3) refactored code to new CheckIfTokenExpire func, for ppl who like to only check if token is expired in Authorization, mainly for SPA use, one way to refresh is to only refresh on application load
- Loading branch information
Showing
1 changed file
with
32 additions
and
9 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