Guest User

Untitled

a guest
Jul 18th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. import jwtDecode from 'jwt-decode'
  2. import moment from 'moment'
  3.  
  4. const isExpired = (token) => {
  5. const expiration = jwtDecode(token).exp
  6. return moment.unix(expiration) - moment(Date.now()) < 30
  7. }
Add Comment
Please, Sign In to add comment