Skip to content

Instantly share code, notes, and snippets.

@mealCode
Last active August 3, 2021 04:25
Show Gist options
  • Save mealCode/eac0f387a7ca2724757429b56a6a547c to your computer and use it in GitHub Desktop.
Save mealCode/eac0f387a7ca2724757429b56a6a547c to your computer and use it in GitHub Desktop.
manual token expiration
// expires in 1hr
const d = new Date()
d.setHours(d.getHours() + 1)
const expiration = new Date(d)
if (expiration < new Date()) {
// token expired
}
// .getMinutes() -> if you want to expires in minutes and so on...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment