|
|
|
@ -22,6 +22,7 @@ import { DigitalIdComponent } from '../digital-id/digital-id.component';
|
|
|
|
import { AppUpdateComponent } from '../app-update/app-update.component';
|
|
|
|
import { AppUpdateComponent } from '../app-update/app-update.component';
|
|
|
|
import { Password } from '../models/password';
|
|
|
|
import { Password } from '../models/password';
|
|
|
|
import { CheckUserAuthenticationRequest } from 'src/app/hmg-common/services/authentication/models/check-user-auth.request';
|
|
|
|
import { CheckUserAuthenticationRequest } from 'src/app/hmg-common/services/authentication/models/check-user-auth.request';
|
|
|
|
|
|
|
|
import { SmsRetriever } from '@ionic-native/sms-retriever/ngx';
|
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
@Component({
|
|
|
|
selector: 'app-confirm-login',
|
|
|
|
selector: 'app-confirm-login',
|
|
|
|
@ -57,6 +58,7 @@ export class ConfirmLoginComponent implements OnInit {
|
|
|
|
userInfo: any;
|
|
|
|
userInfo: any;
|
|
|
|
public businessInfo: object;
|
|
|
|
public businessInfo: object;
|
|
|
|
private checkUserResult: CheckUserAuthenticationResponse;
|
|
|
|
private checkUserResult: CheckUserAuthenticationResponse;
|
|
|
|
|
|
|
|
private signature: string;
|
|
|
|
constructor(
|
|
|
|
constructor(
|
|
|
|
public ts: TranslatorService,
|
|
|
|
public ts: TranslatorService,
|
|
|
|
public cs: CommonService,
|
|
|
|
public cs: CommonService,
|
|
|
|
@ -67,7 +69,8 @@ export class ConfirmLoginComponent implements OnInit {
|
|
|
|
public platform: Platform,
|
|
|
|
public platform: Platform,
|
|
|
|
public modalController: ModalController,
|
|
|
|
public modalController: ModalController,
|
|
|
|
public alertController: AlertController,
|
|
|
|
public alertController: AlertController,
|
|
|
|
private nfc: NFC
|
|
|
|
private nfc: NFC,
|
|
|
|
|
|
|
|
private smsRetriever: SmsRetriever
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
this.loginData = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
|
|
|
|
this.loginData = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
|
|
|
|
this.deviceToken = this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false);
|
|
|
|
this.deviceToken = this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false);
|
|
|
|
@ -87,6 +90,7 @@ export class ConfirmLoginComponent implements OnInit {
|
|
|
|
this.direction = TranslatorService.getCurrentLanguageName();
|
|
|
|
this.direction = TranslatorService.getCurrentLanguageName();
|
|
|
|
this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser'));
|
|
|
|
this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser'));
|
|
|
|
this.checkNFCStatus();
|
|
|
|
this.checkNFCStatus();
|
|
|
|
|
|
|
|
this.generateSMSsignature();
|
|
|
|
// **checkIfAvailable FAIO **//
|
|
|
|
// **checkIfAvailable FAIO **//
|
|
|
|
this.checkIfAvailable();
|
|
|
|
this.checkIfAvailable();
|
|
|
|
// **getSharedData of IMEI_USER_DATA and REGISTER_DATA_FOR_LOGIIN to set defult value **//
|
|
|
|
// **getSharedData of IMEI_USER_DATA and REGISTER_DATA_FOR_LOGIIN to set defult value **//
|
|
|
|
@ -228,13 +232,18 @@ export class ConfirmLoginComponent implements OnInit {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public generateSMSsignature() {
|
|
|
|
|
|
|
|
this.smsRetriever.getAppHash()
|
|
|
|
|
|
|
|
.then((res: any) => this.signature = res)
|
|
|
|
|
|
|
|
.catch((error: any) => console.error(error));
|
|
|
|
|
|
|
|
}
|
|
|
|
public sendActivationCode(type: number) {
|
|
|
|
public sendActivationCode(type: number) {
|
|
|
|
|
|
|
|
console.log(this.signature);
|
|
|
|
const request = new SendActivationByType();
|
|
|
|
const request = new SendActivationByType();
|
|
|
|
this.authService.setPublicFields(request);
|
|
|
|
this.authService.setPublicFields(request);
|
|
|
|
request.OTP_SendType = type;
|
|
|
|
request.OTP_SendType = type;
|
|
|
|
request.MobileNumber = this.loginData.MobileNumber;
|
|
|
|
request.MobileNumber = '0593233758';//this.loginData.MobileNumber;
|
|
|
|
|
|
|
|
request.smsSignature = this.signature;
|
|
|
|
request.IsMobileFingerPrint = 0;
|
|
|
|
request.IsMobileFingerPrint = 0;
|
|
|
|
|
|
|
|
|
|
|
|
request.P_USER_NAME = this.loginData.P_USER_NAME;
|
|
|
|
request.P_USER_NAME = this.loginData.P_USER_NAME;
|
|
|
|
|