1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-07-18 14:15:03 +02:00

fix callback for setUserIdAndEmail

This commit is contained in:
Kyle Spearrin 2017-11-03 15:56:22 -04:00
parent cee9face7f
commit 6d89cc91f7
2 changed files with 2 additions and 9 deletions

View File

@ -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;

View File

@ -15,7 +15,6 @@ export default class UserService {
constructor(private tokenService: TokenService) {
}
// TODO: fix callbacks
setUserIdAndEmail(userId: string, email: string): Promise<any> {
this.email = email;
this.userId = userId;