]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/angular/users/models/user.ts
Fix client linting
[github/Chocobozzz/PeerTube.git] / client / angular / users / models / user.ts
CommitLineData
1553e15d
C
1import { Token } from './token';
2
3export class User {
4 username: string;
5 token: Token;
6
881a5e68
C
7 static load(): User {
8 return new User(localStorage.getItem('username'), Token.load());
9 }
10
1553e15d
C
11 constructor (username: string, hash_token: any) {
12 this.username = username;
13 this.token = new Token(hash_token);
14 }
15
1553e15d
C
16 save(): void {
17 localStorage.setItem('username', this.username);
18 this.token.save();
19 }
20}