use TwoFactorProviderType enum for remember me

This commit is contained in:
Kyle Spearrin 2018-04-19 14:07:11 -04:00
parent 23917010a7
commit fae4530564
2 changed files with 6 additions and 7 deletions

View File

@ -1,14 +1,16 @@
import { TwoFactorProviderType } from '../../enums/twoFactorProviderType';
import { DeviceRequest } from './deviceRequest';
export class TokenRequest {
email: string;
masterPasswordHash: string;
token: string;
provider: number;
provider: TwoFactorProviderType;
remember: boolean;
device?: DeviceRequest;
constructor(email: string, masterPasswordHash: string, provider: number,
constructor(email: string, masterPasswordHash: string, provider: TwoFactorProviderType,
token: string, remember: boolean, device?: DeviceRequest) {
this.email = email;
this.masterPasswordHash = masterPasswordHash;

View File

@ -9,8 +9,6 @@ import { TokenRequest } from '../models/request/tokenRequest';
import { IdentityTokenResponse } from '../models/response/identityTokenResponse';
import { IdentityTwoFactorResponse } from '../models/response/identityTwoFactorResponse';
import { ConstantsService } from '../services/constants.service';
import { ApiService } from '../abstractions/api.service';
import { AppIdService } from '../abstractions/appId.service';
import { CryptoService } from '../abstractions/crypto.service';
@ -69,8 +67,7 @@ export class AuthService {
constructor(private cryptoService: CryptoService, private apiService: ApiService, private userService: UserService,
private tokenService: TokenService, private appIdService: AppIdService, private i18nService: I18nService,
private platformUtilsService: PlatformUtilsService, private constantsService: ConstantsService,
private messagingService: MessagingService) {
private platformUtilsService: PlatformUtilsService, private messagingService: MessagingService) {
}
init() {
@ -152,7 +149,7 @@ export class AuthService {
request = new TokenRequest(email, hashedPassword, twoFactorProvider, twoFactorToken, remember,
deviceRequest);
} else if (storedTwoFactorToken != null) {
request = new TokenRequest(email, hashedPassword, this.constantsService.twoFactorProvider.remember,
request = new TokenRequest(email, hashedPassword, TwoFactorProviderType.Remember,
storedTwoFactorToken, false, deviceRequest);
} else {
request = new TokenRequest(email, hashedPassword, null, null, false, deviceRequest);