Skip to content
Snippets Groups Projects
Commit 52e62eba authored by Xiao Gui's avatar Xiao Gui
Browse files

bugfix: fix occassional invalid access token

parent 404eaa1d
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,9 @@ const getPublicAccessToken = async () => {
const decoded = jwtDecode(__publicAccessToken)
const { exp } = decoded
if (!exp || isNaN(exp) || (exp * 1000 - Date.now() < 0)) {
// refresh token if it is less than 30 minute expiring
if (!exp || isNaN(exp) || (exp * 1000 - Date.now() < 1e3 * 60 * 30 )) {
await refreshToken()
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment