From a840d396093ef968f9512862197ac166a1ff9921 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 1 Jun 2016 20:36:27 +0200 Subject: Add authentication tokens to make friends/quit friends --- client/app/users/shared/token.model.ts | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 client/app/users/shared/token.model.ts (limited to 'client/app/users/shared/token.model.ts') diff --git a/client/app/users/shared/token.model.ts b/client/app/users/shared/token.model.ts deleted file mode 100644 index 021c83fad..000000000 --- a/client/app/users/shared/token.model.ts +++ /dev/null @@ -1,32 +0,0 @@ -export class Token { - access_token: string; - refresh_token: string; - token_type: string; - - static load() { - 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; - this.refresh_token = hash.refresh_token; - - if (hash.token_type === 'bearer') { - this.token_type = 'Bearer'; - } else { - 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); - } -} -- cgit v1.2.3