Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

expiry data of jwt token

function isTokenExpired(token) {
  const expiry = (JSON.parse(atob(token.split('.')[1]))).exp;
  return (Math.floor((new Date).getTime() / 1000)) >= expiry;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #expiry #data #jwt #token
ADD COMMENT
Topic
Name
2+6 =