mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Login in Angular : first draft
This commit is contained in:
parent
13ce1d01c9
commit
b1794c53ac
8 changed files with 163 additions and 3 deletions
17
client/angular/users/models/token.ts
Normal file
17
client/angular/users/models/token.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
export class Token {
|
||||
access_token: string;
|
||||
refresh_token: string;
|
||||
token_type: string;
|
||||
|
||||
constructor (hash) {
|
||||
this.access_token = hash.access_token;
|
||||
this.refresh_token = hash.refresh_token;
|
||||
this.token_type = hash.token_type;
|
||||
}
|
||||
|
||||
save() {
|
||||
localStorage.setItem('access_token', this.access_token);
|
||||
localStorage.setItem('refresh_token', this.refresh_token);
|
||||
localStorage.setItem('token_type', this.token_type);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue