diff options
Diffstat (limited to 'client/angular/users/models')
-rw-r--r-- | client/angular/users/models/authStatus.ts | 4 | ||||
-rw-r--r-- | client/angular/users/models/token.ts | 17 |
2 files changed, 21 insertions, 0 deletions
diff --git a/client/angular/users/models/authStatus.ts b/client/angular/users/models/authStatus.ts new file mode 100644 index 000000000..f646bd4cf --- /dev/null +++ b/client/angular/users/models/authStatus.ts | |||
@@ -0,0 +1,4 @@ | |||
1 | export enum AuthStatus { | ||
2 | LoggedIn, | ||
3 | LoggedOut | ||
4 | } | ||
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 | } | ||