Created
September 16, 2019 07:09
-
-
Save phatnguyenuit/3f7553d258b3ab95ca685cca6f2c4f9f to your computer and use it in GitHub Desktop.
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
import jwt_decode from 'jwt-decode'; | |
export const isExpiredToken = token => { | |
if (!token) return false; | |
var decoded_jwt = jwt_decode(token); | |
var current_time = new Date().getTime() / 1000; | |
return current_time > decoded_jwt.exp; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment