Skip to content

Instantly share code, notes, and snippets.

@nhattruongniit
Created December 20, 2022 13:03
Show Gist options
  • Select an option

  • Save nhattruongniit/4f3099b0de696041f26617a4894f75cb to your computer and use it in GitHub Desktop.

Select an option

Save nhattruongniit/4f3099b0de696041f26617a4894f75cb to your computer and use it in GitHub Desktop.
check-expired-refresh-token
const now = new Date().getTime();
const OFFSET_EXPIRE_TIME = 10 * 1000, // 10s
const isExpired = Boolean(expires_at && now - expires_at * 1000 > OFFSET_EXPIRE_TIME);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment