mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-11 00:57:09 +01:00
small refactor
This commit is contained in:
parent
d16615bf4b
commit
3bef72c717
1 changed files with 3 additions and 7 deletions
|
|
@ -54,13 +54,9 @@ export class AuthService {
|
||||||
map(tokenResponse => {
|
map(tokenResponse => {
|
||||||
this.currentUsername = username
|
this.currentUsername = username
|
||||||
this.token = tokenResponse.token
|
this.token = tokenResponse.token
|
||||||
if (rememberMe) {
|
let storage = rememberMe ? localStorage : sessionStorage
|
||||||
localStorage.setItem('auth-service:token', this.token)
|
storage.setItem('auth-service:token', this.token)
|
||||||
localStorage.setItem('auth-service:currentUsername', this.currentUsername)
|
storage.setItem('auth-service:currentUsername', this.currentUsername)
|
||||||
} else {
|
|
||||||
sessionStorage.setItem('auth-service:token', this.token)
|
|
||||||
sessionStorage.setItem('auth-service:currentUsername', this.currentUsername)
|
|
||||||
}
|
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue