mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-05-01 11:19:32 -05:00
small refactor
This commit is contained in:
parent
b7521dad0f
commit
818be29c67
@ -54,13 +54,9 @@ export class AuthService {
|
||||
map(tokenResponse => {
|
||||
this.currentUsername = username
|
||||
this.token = tokenResponse.token
|
||||
if (rememberMe) {
|
||||
localStorage.setItem('auth-service:token', this.token)
|
||||
localStorage.setItem('auth-service:currentUsername', this.currentUsername)
|
||||
} else {
|
||||
sessionStorage.setItem('auth-service:token', this.token)
|
||||
sessionStorage.setItem('auth-service:currentUsername', this.currentUsername)
|
||||
}
|
||||
let storage = rememberMe ? localStorage : sessionStorage
|
||||
storage.setItem('auth-service:token', this.token)
|
||||
storage.setItem('auth-service:currentUsername', this.currentUsername)
|
||||
return true
|
||||
})
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user