fix: frontend token validation

fix filebrowser/filebrowser#638
pull/991/head
Ramires Viana 2020-01-16 13:47:21 +00:00
parent 963837ef1d
commit dd40b0d9b9
1 changed files with 0 additions and 4 deletions

View File

@ -12,10 +12,6 @@ export function parseToken (token) {
const data = JSON.parse(Base64.decode(parts[1])) const data = JSON.parse(Base64.decode(parts[1]))
if (Math.round(new Date().getTime() / 1000) > data.exp) {
throw new Error('token expired')
}
localStorage.setItem('jwt', token) localStorage.setItem('jwt', token)
store.commit('setJWT', token) store.commit('setJWT', token)
store.commit('setUser', data.user) store.commit('setUser', data.user)