aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/angular/users/models/token.ts
blob: 688dfdc803c2d08c83d949a0216be8cd4f7ecefa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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);
  }
}