Last active
August 3, 2021 04:25
-
-
Save mealCode/eac0f387a7ca2724757429b56a6a547c to your computer and use it in GitHub Desktop.
manual 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
// 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