Created
October 21, 2023 17:51
-
-
Save orcchg/95c72559147ef98fa4c4fcf3cadee16c to your computer and use it in GitHub Desktop.
Check for token existence and 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
if (accessToken != null && System.currentTimeMillis() < accessToken.createdAt + accessToken.expiresIn) { | |
return@synchronized accessToken.toString() // access token is valid | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment