Fix tokens loading

pull/3105/head
Chocobozzz 2020-08-21 13:49:48 +02:00 committed by Chocobozzz
parent 7294aab0c8
commit 79f392a657
1 changed files with 4 additions and 2 deletions

View File

@ -25,11 +25,13 @@ export class AuthUser extends User implements ServerMyUserModel {
canSeeVideosLink = true canSeeVideosLink = true
static load () { static load () {
const userInfo = getUserInfoFromLocalStorage() const tokens = Tokens.load()
if (!tokens) return null
const userInfo = getUserInfoFromLocalStorage()
if (!userInfo) return null if (!userInfo) return null
return new AuthUser(userInfo, Tokens.load()) return new AuthUser(userInfo, tokens)
} }
static flush () { static flush () {