aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/app/users/shared/token.model.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-05-27 17:25:52 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-05-27 17:25:52 +0200
commitccf6ed16f1eeb05b77103bd44bc06ccbbbba9bdd (patch)
tree1765f48824be934e0be07e8a987a9513c58ba3da /client/app/users/shared/token.model.ts
parent41a2aee38cf812510010da09de9bae53590ec119 (diff)
downloadPeerTube-ccf6ed16f1eeb05b77103bd44bc06ccbbbba9bdd.tar.gz
PeerTube-ccf6ed16f1eeb05b77103bd44bc06ccbbbba9bdd.tar.zst
PeerTube-ccf6ed16f1eeb05b77103bd44bc06ccbbbba9bdd.zip
Do not prefix private attributes
Diffstat (limited to 'client/app/users/shared/token.model.ts')
-rw-r--r--client/app/users/shared/token.model.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/client/app/users/shared/token.model.ts b/client/app/users/shared/token.model.ts
index b7872e74a..021c83fad 100644
--- a/client/app/users/shared/token.model.ts
+++ b/client/app/users/shared/token.model.ts
@@ -3,7 +3,7 @@ export class Token {
3 refresh_token: string; 3 refresh_token: string;
4 token_type: string; 4 token_type: string;
5 5
6 static load(): Token { 6 static load() {
7 return new Token({ 7 return new Token({
8 access_token: localStorage.getItem('access_token'), 8 access_token: localStorage.getItem('access_token'),
9 refresh_token: localStorage.getItem('refresh_token'), 9 refresh_token: localStorage.getItem('refresh_token'),
@@ -11,10 +11,11 @@ export class Token {
11 }); 11 });
12 } 12 }
13 13
14 constructor (hash?: any) { 14 constructor(hash?: any) {
15 if (hash) { 15 if (hash) {
16 this.access_token = hash.access_token; 16 this.access_token = hash.access_token;
17 this.refresh_token = hash.refresh_token; 17 this.refresh_token = hash.refresh_token;
18
18 if (hash.token_type === 'bearer') { 19 if (hash.token_type === 'bearer') {
19 this.token_type = 'Bearer'; 20 this.token_type = 'Bearer';
20 } else { 21 } else {
@@ -23,7 +24,7 @@ export class Token {
23 } 24 }
24 } 25 }
25 26
26 save():void { 27 save() {
27 localStorage.setItem('access_token', this.access_token); 28 localStorage.setItem('access_token', this.access_token);
28 localStorage.setItem('refresh_token', this.refresh_token); 29 localStorage.setItem('refresh_token', this.refresh_token);
29 localStorage.setItem('token_type', this.token_type); 30 localStorage.setItem('token_type', this.token_type);