aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/angular/users/models/token.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-03-22 15:51:54 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-03-22 15:51:54 +0100
commitb1794c53ac97d77a16c10ed915336f08cff1e5e3 (patch)
tree9dd64ee8316e1e60c434a7d0a6dcbace49eb4d6b /client/angular/users/models/token.ts
parent13ce1d01c953f0c4fd3b1d714c016f927dc16f66 (diff)
downloadPeerTube-b1794c53ac97d77a16c10ed915336f08cff1e5e3.tar.gz
PeerTube-b1794c53ac97d77a16c10ed915336f08cff1e5e3.tar.zst
PeerTube-b1794c53ac97d77a16c10ed915336f08cff1e5e3.zip
Login in Angular : first draft
Diffstat (limited to 'client/angular/users/models/token.ts')
-rw-r--r--client/angular/users/models/token.ts17
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 @@
1export 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}