use TwoFactorProviderType enum for remember me
This commit is contained in:
parent
23917010a7
commit
fae4530564
|
@ -1,14 +1,16 @@
|
||||||
|
import { TwoFactorProviderType } from '../../enums/twoFactorProviderType';
|
||||||
|
|
||||||
import { DeviceRequest } from './deviceRequest';
|
import { DeviceRequest } from './deviceRequest';
|
||||||
|
|
||||||
export class TokenRequest {
|
export class TokenRequest {
|
||||||
email: string;
|
email: string;
|
||||||
masterPasswordHash: string;
|
masterPasswordHash: string;
|
||||||
token: string;
|
token: string;
|
||||||
provider: number;
|
provider: TwoFactorProviderType;
|
||||||
remember: boolean;
|
remember: boolean;
|
||||||
device?: DeviceRequest;
|
device?: DeviceRequest;
|
||||||
|
|
||||||
constructor(email: string, masterPasswordHash: string, provider: number,
|
constructor(email: string, masterPasswordHash: string, provider: TwoFactorProviderType,
|
||||||
token: string, remember: boolean, device?: DeviceRequest) {
|
token: string, remember: boolean, device?: DeviceRequest) {
|
||||||
this.email = email;
|
this.email = email;
|
||||||
this.masterPasswordHash = masterPasswordHash;
|
this.masterPasswordHash = masterPasswordHash;
|
||||||
|
|
|
@ -9,8 +9,6 @@ import { TokenRequest } from '../models/request/tokenRequest';
|
||||||
import { IdentityTokenResponse } from '../models/response/identityTokenResponse';
|
import { IdentityTokenResponse } from '../models/response/identityTokenResponse';
|
||||||
import { IdentityTwoFactorResponse } from '../models/response/identityTwoFactorResponse';
|
import { IdentityTwoFactorResponse } from '../models/response/identityTwoFactorResponse';
|
||||||
|
|
||||||
import { ConstantsService } from '../services/constants.service';
|
|
||||||
|
|
||||||
import { ApiService } from '../abstractions/api.service';
|
import { ApiService } from '../abstractions/api.service';
|
||||||
import { AppIdService } from '../abstractions/appId.service';
|
import { AppIdService } from '../abstractions/appId.service';
|
||||||
import { CryptoService } from '../abstractions/crypto.service';
|
import { CryptoService } from '../abstractions/crypto.service';
|
||||||
|
@ -69,8 +67,7 @@ export class AuthService {
|
||||||
|
|
||||||
constructor(private cryptoService: CryptoService, private apiService: ApiService, private userService: UserService,
|
constructor(private cryptoService: CryptoService, private apiService: ApiService, private userService: UserService,
|
||||||
private tokenService: TokenService, private appIdService: AppIdService, private i18nService: I18nService,
|
private tokenService: TokenService, private appIdService: AppIdService, private i18nService: I18nService,
|
||||||
private platformUtilsService: PlatformUtilsService, private constantsService: ConstantsService,
|
private platformUtilsService: PlatformUtilsService, private messagingService: MessagingService) {
|
||||||
private messagingService: MessagingService) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
|
@ -152,7 +149,7 @@ export class AuthService {
|
||||||
request = new TokenRequest(email, hashedPassword, twoFactorProvider, twoFactorToken, remember,
|
request = new TokenRequest(email, hashedPassword, twoFactorProvider, twoFactorToken, remember,
|
||||||
deviceRequest);
|
deviceRequest);
|
||||||
} else if (storedTwoFactorToken != null) {
|
} else if (storedTwoFactorToken != null) {
|
||||||
request = new TokenRequest(email, hashedPassword, this.constantsService.twoFactorProvider.remember,
|
request = new TokenRequest(email, hashedPassword, TwoFactorProviderType.Remember,
|
||||||
storedTwoFactorToken, false, deviceRequest);
|
storedTwoFactorToken, false, deviceRequest);
|
||||||
} else {
|
} else {
|
||||||
request = new TokenRequest(email, hashedPassword, null, null, false, deviceRequest);
|
request = new TokenRequest(email, hashedPassword, null, null, false, deviceRequest);
|
||||||
|
|
Loading…
Reference in New Issue