]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix client linting
authorChocobozzz <florian.bigard@gmail.com>
Wed, 11 May 2016 18:46:45 +0000 (20:46 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Fri, 13 May 2016 12:23:11 +0000 (14:23 +0200)
client/angular/users/models/token.ts
client/angular/users/models/user.ts

index 906bf501b401595b4dca25d6fe042b6e114ec53f..b7872e74a1fe69583ce796e919518ec5b26c0a69 100644 (file)
@@ -3,6 +3,14 @@ export class Token {
   refresh_token: string;
   token_type: string;
 
+  static load(): Token {
+    return new Token({
+      access_token: localStorage.getItem('access_token'),
+      refresh_token: localStorage.getItem('refresh_token'),
+      token_type: localStorage.getItem('token_type')
+    });
+  }
+
   constructor (hash?: any) {
     if (hash) {
       this.access_token = hash.access_token;
@@ -15,14 +23,6 @@ export class Token {
     }
   }
 
-  static load(): Token {
-    return new Token({
-      access_token: localStorage.getItem('access_token'),
-      refresh_token: localStorage.getItem('refresh_token'),
-      token_type: localStorage.getItem('token_type')
-    });
-  }
-
   save():void {
     localStorage.setItem('access_token', this.access_token);
     localStorage.setItem('refresh_token', this.refresh_token);
index 2c56a61327a8fd4186b81d290592c38b00e9a661..3367e3bb52cd5fbeaae9898f21eefe8275571d69 100644 (file)
@@ -4,15 +4,15 @@ export class User {
   username: string;
   token: Token;
 
+  static load(): User {
+    return new User(localStorage.getItem('username'), Token.load());
+  }
+
   constructor (username: string, hash_token: any) {
     this.username = username;
     this.token = new Token(hash_token);
   }
 
-  static load(): User {
-    return new User(localStorage.getItem('username'), Token.load());
-  }
-
   save(): void {
     localStorage.setItem('username', this.username);
     this.token.save();