diff options
Diffstat (limited to 'client/angular/users/models/token.ts')
-rw-r--r-- | client/angular/users/models/token.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/client/angular/users/models/token.ts b/client/angular/users/models/token.ts new file mode 100644 index 000000000..688dfdc80 --- /dev/null +++ b/client/angular/users/models/token.ts | |||
@@ -0,0 +1,17 @@ | |||
1 | export class Token { | ||
2 | access_token: string; | ||
3 | refresh_token: string; | ||
4 | token_type: string; | ||
5 | |||
6 | constructor (hash) { | ||
7 | this.access_token = hash.access_token; | ||
8 | this.refresh_token = hash.refresh_token; | ||
9 | this.token_type = hash.token_type; | ||
10 | } | ||
11 | |||
12 | save() { | ||
13 | localStorage.setItem('access_token', this.access_token); | ||
14 | localStorage.setItem('refresh_token', this.refresh_token); | ||
15 | localStorage.setItem('token_type', this.token_type); | ||
16 | } | ||
17 | } | ||