Skip to content
Snippets Groups Projects
Commit a5162d33 authored by moon's avatar moon
Browse files

fix: add an environment variable, VUE_APP_USER_EXPIRE_SEC for having the expiring time

parent a4a68a7b
Branches auto_logout
No related tags found
No related merge requests found
......@@ -62,7 +62,14 @@ const actions = {
(hr*3600000)
*/
// const expiresIn = 60 * 1000
const expiresIn = 20000
// const expiresIn = 20000
let expiresIn = 20000
if ( process.env.VUE_APP_USER_EXPIRE_SEC ) {
expiresIn = parseInt( process.env.VUE_APP_USER_EXPIRE_SEC )
} else {
console.error( 'Please setup VUE_APP_USER_EXPIRE_SEC environment variable. Default expiration time is 20 seconds')
}
const expirationDate = new Date().getTime() + expiresIn
localStorage.setItem('tokenExpiration', expirationDate)
commit('SET_USER_DATA', userData);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment