mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-15 05:41:34 +00:00
don't save proxy user's tokens in localstorage
we still want those tokens, we will use them in the mobile app. but we don't want them client side, otherwise proxy users remain logged in. we centralize the logic around storing the token, and turn `setUser` into an action vs a mutation
This commit is contained in:
parent
096b5496b3
commit
63f1df4015
5 changed files with 19 additions and 24 deletions
|
|
@ -158,8 +158,6 @@ class Auth {
|
|||
email,
|
||||
type: 'user',
|
||||
isActive: true,
|
||||
token: null,
|
||||
isFromProxy: true,
|
||||
}
|
||||
|
||||
return await this.createUser(account)
|
||||
|
|
@ -179,12 +177,7 @@ class Auth {
|
|||
delete account.password
|
||||
|
||||
account.pash = await this.hashPass(password)
|
||||
|
||||
// proxy users don't get a token
|
||||
if (!account.isFromProxy) {
|
||||
account.token = await this.generateAccessToken({ userId: account.id, username })
|
||||
}
|
||||
|
||||
account.token = await this.generateAccessToken({ userId: account.id, username })
|
||||
account.createdAt = Date.now()
|
||||
const newUser = new User(account)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue