Fix client linting
This commit is contained in:
parent
09bc69df7a
commit
881a5e68b6
|
@ -3,6 +3,14 @@ export class Token {
|
||||||
refresh_token: string;
|
refresh_token: string;
|
||||||
token_type: string;
|
token_type: string;
|
||||||
|
|
||||||
|
static load(): Token {
|
||||||
|
return new Token({
|
||||||
|
access_token: localStorage.getItem('access_token'),
|
||||||
|
refresh_token: localStorage.getItem('refresh_token'),
|
||||||
|
token_type: localStorage.getItem('token_type')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
constructor (hash?: any) {
|
constructor (hash?: any) {
|
||||||
if (hash) {
|
if (hash) {
|
||||||
this.access_token = hash.access_token;
|
this.access_token = hash.access_token;
|
||||||
|
@ -15,14 +23,6 @@ export class Token {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static load(): Token {
|
|
||||||
return new Token({
|
|
||||||
access_token: localStorage.getItem('access_token'),
|
|
||||||
refresh_token: localStorage.getItem('refresh_token'),
|
|
||||||
token_type: localStorage.getItem('token_type')
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
save():void {
|
save():void {
|
||||||
localStorage.setItem('access_token', this.access_token);
|
localStorage.setItem('access_token', this.access_token);
|
||||||
localStorage.setItem('refresh_token', this.refresh_token);
|
localStorage.setItem('refresh_token', this.refresh_token);
|
||||||
|
|
|
@ -4,15 +4,15 @@ export class User {
|
||||||
username: string;
|
username: string;
|
||||||
token: Token;
|
token: Token;
|
||||||
|
|
||||||
|
static load(): User {
|
||||||
|
return new User(localStorage.getItem('username'), Token.load());
|
||||||
|
}
|
||||||
|
|
||||||
constructor (username: string, hash_token: any) {
|
constructor (username: string, hash_token: any) {
|
||||||
this.username = username;
|
this.username = username;
|
||||||
this.token = new Token(hash_token);
|
this.token = new Token(hash_token);
|
||||||
}
|
}
|
||||||
|
|
||||||
static load(): User {
|
|
||||||
return new User(localStorage.getItem('username'), Token.load());
|
|
||||||
}
|
|
||||||
|
|
||||||
save(): void {
|
save(): void {
|
||||||
localStorage.setItem('username', this.username);
|
localStorage.setItem('username', this.username);
|
||||||
this.token.save();
|
this.token.save();
|
||||||
|
|
Loading…
Reference in New Issue