Created
April 30, 2022 09:47
-
-
Save dgtlmonk/03b2a329f3f6651eb442b6fa32664c97 to your computer and use it in GitHub Desktop.
check token expiration
This file contains hidden or 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 dateDiff from "date-fns/differenceInDays" | |
// JWT Token | |
dateExp = new Date(getToken().exp * 1000) | |
isTokenExpired = dateDiff(dateExp, Date.now()) < 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment