From 6d89cc91f7fd164f05fea5adab80863190471c1f Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 3 Nov 2017 15:56:22 -0400 Subject: [PATCH] fix callback for setUserIdAndEmail --- src/popup/app/services/auth.service.ts | 10 ++-------- src/services/user.service.ts | 1 - 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/popup/app/services/auth.service.ts b/src/popup/app/services/auth.service.ts index 2cc44867cd..4bc9fb52d7 100644 --- a/src/popup/app/services/auth.service.ts +++ b/src/popup/app/services/auth.service.ts @@ -4,7 +4,7 @@ import { TokenRequest } from '../../../models/request/tokenRequest'; class AuthService { constructor(public cryptoService: any, public apiService: any, public userService: any, public tokenService: any, - public $rootScope: any, public appIdService: any, public utilsService: any, + public $rootScope: any, public appIdService: any, public utilsService: any, public constantsService: any) { } @@ -52,7 +52,7 @@ class AuthService { await this.tokenService.setTokens(response.accessToken, response.refreshToken); await this.cryptoService.setKey(key); await this.cryptoService.setKeyHash(hashedPassword); - await this.setUserIdAndEmail(this.tokenService.getUserId(), this.tokenService.getEmail()); + await this.userService.setUserIdAndEmail(this.tokenService.getUserId(), this.tokenService.getEmail()); await this.cryptoService.setEncKey(response.key); await this.cryptoService.setEncPrivateKey(response.privateKey); @@ -63,12 +63,6 @@ class AuthService { }; } - setUserIdAndEmail(userId: any, email: any) { - return new Promise((resolve) => { - return this.userService.setUserIdAndEmail(userId, email, resolve); - }); - } - logOut(callback: Function) { this.$rootScope.vaultCiphers = null; this.$rootScope.vaultFolders = null; diff --git a/src/services/user.service.ts b/src/services/user.service.ts index 060eb78223..caa56c0d6f 100644 --- a/src/services/user.service.ts +++ b/src/services/user.service.ts @@ -15,7 +15,6 @@ export default class UserService { constructor(private tokenService: TokenService) { } - // TODO: fix callbacks setUserIdAndEmail(userId: string, email: string): Promise { this.email = email; this.userId = userId;