Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import jwtDecode from 'jwt-decode'
- import moment from 'moment'
- const isExpired = (token) => {
- const expiration = jwtDecode(token).exp
- return moment.unix(expiration) - moment(Date.now()) < 30
- }
Add Comment
Please, Sign In to add comment