|
|
|
|
@ -34,8 +34,7 @@ export class LoginComponent implements OnInit, OnDestroy {
|
|
|
|
|
private password: string;
|
|
|
|
|
private language: string;
|
|
|
|
|
private username : string;
|
|
|
|
|
|
|
|
|
|
private currentLang : any;
|
|
|
|
|
private currentLang : any = 2;
|
|
|
|
|
private patientOutSA: boolean;
|
|
|
|
|
private loginTokenID: string;
|
|
|
|
|
private isMobileFingerPrint: boolean;
|
|
|
|
|
@ -57,12 +56,13 @@ export class LoginComponent implements OnInit, OnDestroy {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
console.log(this.currentLang);
|
|
|
|
|
//this.setIdPattern();
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.checkIfLoggedInBefore();
|
|
|
|
|
// this.splash.hide();
|
|
|
|
|
}, 100);
|
|
|
|
|
this.currentLang = TranslatorService.getCurrentLanguageCode();
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// this.checkIfLoggedInBefore();
|
|
|
|
|
// // this.splash.hide();
|
|
|
|
|
// }, 100);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngOnDestroy(): void {
|
|
|
|
|
@ -70,7 +70,6 @@ export class LoginComponent implements OnInit, OnDestroy {
|
|
|
|
|
}
|
|
|
|
|
public changeLanguage(){
|
|
|
|
|
this.ts.switchLanguage();
|
|
|
|
|
console.log(this.ts.getCurrentSystemLanguageName());
|
|
|
|
|
if(TranslatorService.CURRENT_LANGUAGE == TranslatorService.EN)
|
|
|
|
|
{
|
|
|
|
|
this.language = "US";
|
|
|
|
|
@ -79,19 +78,19 @@ export class LoginComponent implements OnInit, OnDestroy {
|
|
|
|
|
this.language = "AR";
|
|
|
|
|
}
|
|
|
|
|
this.currentLang = TranslatorService.getCurrentLanguageCode();
|
|
|
|
|
console.log(this.currentLang);
|
|
|
|
|
}
|
|
|
|
|
private checkIfLoggedInBefore() {
|
|
|
|
|
this.cs.startLoading();
|
|
|
|
|
// check if user logged in before
|
|
|
|
|
this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
|
|
|
|
|
if (user) {
|
|
|
|
|
this.startBiometricLogin(user);
|
|
|
|
|
} else {
|
|
|
|
|
this.hideSplashScreen(true);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// private checkIfLoggedInBefore() {
|
|
|
|
|
// this.cs.startLoading();
|
|
|
|
|
// // check if user logged in before
|
|
|
|
|
// this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
|
|
|
|
|
// if (user) {
|
|
|
|
|
// this.startBiometricLogin(user);
|
|
|
|
|
// } else {
|
|
|
|
|
// this.hideSplashScreen(true);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
private forgetPasswordPage(){
|
|
|
|
|
this.cs.openUserForgot();
|
|
|
|
|
}
|
|
|
|
|
@ -101,24 +100,24 @@ export class LoginComponent implements OnInit, OnDestroy {
|
|
|
|
|
this.cs.stopLoading();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private startBiometricLogin(user: AuthenticatedUser) {
|
|
|
|
|
this.faio.isAvailable().then((options) => {
|
|
|
|
|
this.hideSplashScreen(true);
|
|
|
|
|
if (user.biometricEnabled) {
|
|
|
|
|
// ask if login with face or finger
|
|
|
|
|
this.cs.presentConfirmDialog(
|
|
|
|
|
this.ts.trPK('login', options),
|
|
|
|
|
() => this.presentBiometricDialog(user),
|
|
|
|
|
() => { }
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
// ask to enable biometric
|
|
|
|
|
this.getPermissionToActivateBiometric(user);
|
|
|
|
|
}
|
|
|
|
|
}, () => {
|
|
|
|
|
this.hideSplashScreen(true);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// private startBiometricLogin(user: AuthenticatedUser) {
|
|
|
|
|
// this.faio.isAvailable().then((options) => {
|
|
|
|
|
// this.hideSplashScreen(true);
|
|
|
|
|
// if (user.biometricEnabled) {
|
|
|
|
|
// // ask if login with face or finger
|
|
|
|
|
// this.cs.presentConfirmDialog(
|
|
|
|
|
// this.ts.trPK('login', options),
|
|
|
|
|
// () => this.presentBiometricDialog(user),
|
|
|
|
|
// () => { }
|
|
|
|
|
// );
|
|
|
|
|
// } else {
|
|
|
|
|
// // ask to enable biometric
|
|
|
|
|
// this.getPermissionToActivateBiometric(user);
|
|
|
|
|
// }
|
|
|
|
|
// }, () => {
|
|
|
|
|
// this.hideSplashScreen(true);
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
private getPermissionToActivateBiometric(user: AuthenticatedUser) {
|
|
|
|
|
this.cs.presentConfirmDialog(
|
|
|
|
|
@ -188,165 +187,165 @@ export class LoginComponent implements OnInit, OnDestroy {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public loginWithMyAccount() {
|
|
|
|
|
// this.loginWithTamer();
|
|
|
|
|
this.loginWithTamer();
|
|
|
|
|
}
|
|
|
|
|
// public loginWithMyAccount() {
|
|
|
|
|
// // this.loginWithTamer();
|
|
|
|
|
// this.loginWithTamer();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
TODO to be removed later
|
|
|
|
|
*/
|
|
|
|
|
public loginWithEnas() {
|
|
|
|
|
alert('you are doing slient login width enas account ');
|
|
|
|
|
const user = new AuthenticatedUser();
|
|
|
|
|
user.PatientID = 862616;
|
|
|
|
|
|
|
|
|
|
user.PatientTypeID = PATIENT_TYPE.PERMANENT;
|
|
|
|
|
user.PatientOutSA = false;
|
|
|
|
|
user.TokenID = '@dm!n';
|
|
|
|
|
user.ProjectID = 0;
|
|
|
|
|
user.NationalityID = '2300948375';
|
|
|
|
|
user.MobileNo = user.MobileNumber = '554355126';
|
|
|
|
|
user.ZipCode = '+966';
|
|
|
|
|
user.Address = 'riyadh';
|
|
|
|
|
user.FirstName = 'MOHAMED';
|
|
|
|
|
user.MiddleName = 'yaghi';
|
|
|
|
|
user.LastName = 'mohammed';
|
|
|
|
|
user.Age = 30;
|
|
|
|
|
user.agreed = true;
|
|
|
|
|
const birthDate = new Date();
|
|
|
|
|
birthDate.setFullYear(birthDate.getFullYear() - 29);
|
|
|
|
|
user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate));
|
|
|
|
|
user.Email = 'Mohamed.Afifi@cloudsolution-sa.com';
|
|
|
|
|
user.PatientName = 'enas yaghi';
|
|
|
|
|
this.authService.updateLoggedInUser(user).subscribe(done => {
|
|
|
|
|
this.authService.startIdleMonitoring();
|
|
|
|
|
this.cs.openHome();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public loginWithVaccineUser() {
|
|
|
|
|
alert('you are doing slient login width vaccine account ');
|
|
|
|
|
const user = new AuthenticatedUser();
|
|
|
|
|
user.PatientID = 862616; // user with vaccines in dev
|
|
|
|
|
|
|
|
|
|
user.PatientTypeID = PATIENT_TYPE.PERMANENT;
|
|
|
|
|
user.PatientOutSA = false;
|
|
|
|
|
user.TokenID = '@dm!n';
|
|
|
|
|
user.NationalityID = '2300948375';
|
|
|
|
|
user.MobileNo = user.MobileNumber = '554355126';
|
|
|
|
|
user.ProjectID = 0;
|
|
|
|
|
user.ZipCode = '+966';
|
|
|
|
|
user.Address = 'riyadh';
|
|
|
|
|
user.FirstName = 'MOHAMED';
|
|
|
|
|
user.MiddleName = 'yaghi';
|
|
|
|
|
user.LastName = 'mohammed';
|
|
|
|
|
user.Age = 30;
|
|
|
|
|
user.agreed = true;
|
|
|
|
|
const birthDate = new Date();
|
|
|
|
|
birthDate.setFullYear(birthDate.getFullYear() - 29);
|
|
|
|
|
user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate));
|
|
|
|
|
user.Email = 'minna.barry@cloudsolution-sa.com';
|
|
|
|
|
user.PatientName = 'enas yaghi';
|
|
|
|
|
this.authService.updateLoggedInUser(user).subscribe(done => {
|
|
|
|
|
this.authService.startIdleMonitoring();
|
|
|
|
|
this.cs.openHome();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public loginWithEyeMeasureUser() {
|
|
|
|
|
alert('you are doing slient login width eye measurements user account ');
|
|
|
|
|
const user = new AuthenticatedUser();
|
|
|
|
|
user.PatientID = 873010;
|
|
|
|
|
|
|
|
|
|
user.PatientTypeID = PATIENT_TYPE.PERMANENT;
|
|
|
|
|
user.PatientOutSA = false;
|
|
|
|
|
user.TokenID = '@dm!n';
|
|
|
|
|
user.NationalityID = '2302581828';
|
|
|
|
|
user.ProjectID = 0;
|
|
|
|
|
user.MobileNo = user.MobileNumber = '555333541';
|
|
|
|
|
user.ZipCode = '+966';
|
|
|
|
|
user.Address = 'riyadh';
|
|
|
|
|
user.FirstName = 'eye';
|
|
|
|
|
user.MiddleName = 'user';
|
|
|
|
|
user.LastName = 'measurment';
|
|
|
|
|
user.Age = 30;
|
|
|
|
|
user.agreed = true;
|
|
|
|
|
const birthDate = new Date();
|
|
|
|
|
birthDate.setFullYear(birthDate.getFullYear() - 29);
|
|
|
|
|
user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate));
|
|
|
|
|
user.Email = 'sultan.khan@hmg.local';
|
|
|
|
|
user.PatientName = 'eye user';
|
|
|
|
|
this.authService.updateLoggedInUser(user).subscribe(done => {
|
|
|
|
|
this.authService.startIdleMonitoring();
|
|
|
|
|
this.cs.openHome();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// public loginWithEnas() {
|
|
|
|
|
// alert('you are doing slient login width enas account ');
|
|
|
|
|
// const user = new AuthenticatedUser();
|
|
|
|
|
// user.PatientID = 862616;
|
|
|
|
|
|
|
|
|
|
// user.PatientTypeID = PATIENT_TYPE.PERMANENT;
|
|
|
|
|
// user.PatientOutSA = false;
|
|
|
|
|
// user.TokenID = '@dm!n';
|
|
|
|
|
// user.ProjectID = 0;
|
|
|
|
|
// user.NationalityID = '2300948375';
|
|
|
|
|
// user.MobileNo = user.MobileNumber = '554355126';
|
|
|
|
|
// user.ZipCode = '+966';
|
|
|
|
|
// user.Address = 'riyadh';
|
|
|
|
|
// user.FirstName = 'MOHAMED';
|
|
|
|
|
// user.MiddleName = 'yaghi';
|
|
|
|
|
// user.LastName = 'mohammed';
|
|
|
|
|
// user.Age = 30;
|
|
|
|
|
// user.agreed = true;
|
|
|
|
|
// const birthDate = new Date();
|
|
|
|
|
// birthDate.setFullYear(birthDate.getFullYear() - 29);
|
|
|
|
|
// user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate));
|
|
|
|
|
// user.Email = 'Mohamed.Afifi@cloudsolution-sa.com';
|
|
|
|
|
// user.PatientName = 'enas yaghi';
|
|
|
|
|
// this.authService.updateLoggedInUser(user).subscribe(done => {
|
|
|
|
|
// this.authService.startIdleMonitoring();
|
|
|
|
|
// this.cs.openHome();
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// public loginWithVaccineUser() {
|
|
|
|
|
// alert('you are doing slient login width vaccine account ');
|
|
|
|
|
// const user = new AuthenticatedUser();
|
|
|
|
|
// user.PatientID = 862616; // user with vaccines in dev
|
|
|
|
|
|
|
|
|
|
// user.PatientTypeID = PATIENT_TYPE.PERMANENT;
|
|
|
|
|
// user.PatientOutSA = false;
|
|
|
|
|
// user.TokenID = '@dm!n';
|
|
|
|
|
// user.NationalityID = '2300948375';
|
|
|
|
|
// user.MobileNo = user.MobileNumber = '554355126';
|
|
|
|
|
// user.ProjectID = 0;
|
|
|
|
|
// user.ZipCode = '+966';
|
|
|
|
|
// user.Address = 'riyadh';
|
|
|
|
|
// user.FirstName = 'MOHAMED';
|
|
|
|
|
// user.MiddleName = 'yaghi';
|
|
|
|
|
// user.LastName = 'mohammed';
|
|
|
|
|
// user.Age = 30;
|
|
|
|
|
// user.agreed = true;
|
|
|
|
|
// const birthDate = new Date();
|
|
|
|
|
// birthDate.setFullYear(birthDate.getFullYear() - 29);
|
|
|
|
|
// user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate));
|
|
|
|
|
// user.Email = 'minna.barry@cloudsolution-sa.com';
|
|
|
|
|
// user.PatientName = 'enas yaghi';
|
|
|
|
|
// this.authService.updateLoggedInUser(user).subscribe(done => {
|
|
|
|
|
// this.authService.startIdleMonitoring();
|
|
|
|
|
// this.cs.openHome();
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public loginWithEyeMeasureUser() {
|
|
|
|
|
// alert('you are doing slient login width eye measurements user account ');
|
|
|
|
|
// const user = new AuthenticatedUser();
|
|
|
|
|
// user.PatientID = 873010;
|
|
|
|
|
|
|
|
|
|
// user.PatientTypeID = PATIENT_TYPE.PERMANENT;
|
|
|
|
|
// user.PatientOutSA = false;
|
|
|
|
|
// user.TokenID = '@dm!n';
|
|
|
|
|
// user.NationalityID = '2302581828';
|
|
|
|
|
// user.ProjectID = 0;
|
|
|
|
|
// user.MobileNo = user.MobileNumber = '555333541';
|
|
|
|
|
// user.ZipCode = '+966';
|
|
|
|
|
// user.Address = 'riyadh';
|
|
|
|
|
// user.FirstName = 'eye';
|
|
|
|
|
// user.MiddleName = 'user';
|
|
|
|
|
// user.LastName = 'measurment';
|
|
|
|
|
// user.Age = 30;
|
|
|
|
|
// user.agreed = true;
|
|
|
|
|
// const birthDate = new Date();
|
|
|
|
|
// birthDate.setFullYear(birthDate.getFullYear() - 29);
|
|
|
|
|
// user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate));
|
|
|
|
|
// user.Email = 'sultan.khan@hmg.local';
|
|
|
|
|
// user.PatientName = 'eye user';
|
|
|
|
|
// this.authService.updateLoggedInUser(user).subscribe(done => {
|
|
|
|
|
// this.authService.startIdleMonitoring();
|
|
|
|
|
// this.cs.openHome();
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
TODO login with mr rwaid
|
|
|
|
|
*/
|
|
|
|
|
public loginWithRwaid() {
|
|
|
|
|
alert('you are doing slient login width mr: rwaid account');
|
|
|
|
|
|
|
|
|
|
const user = new AuthenticatedUser();
|
|
|
|
|
// tamer with eye measurments 1231755
|
|
|
|
|
user.PatientID = 1018977;
|
|
|
|
|
user.PatientTypeID = PATIENT_TYPE.PERMANENT;
|
|
|
|
|
user.ProjectID = 0;
|
|
|
|
|
user.PatientOutSA = false;
|
|
|
|
|
user.TokenID = '@dm!n';
|
|
|
|
|
user.NationalityID = '1001242559';
|
|
|
|
|
user.MobileNo = user.MobileNumber = '545156035';
|
|
|
|
|
user.ZipCode = '+966';
|
|
|
|
|
user.Address = 'riyadh';
|
|
|
|
|
user.FirstName = 'rwaid';
|
|
|
|
|
user.MiddleName = 'el mallah';
|
|
|
|
|
user.LastName = 'mohammed';
|
|
|
|
|
user.Age = 30;
|
|
|
|
|
user.agreed = true;
|
|
|
|
|
const birthDate = new Date();
|
|
|
|
|
birthDate.setFullYear(birthDate.getFullYear() - 29);
|
|
|
|
|
user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate));
|
|
|
|
|
user.Email = 'mohamed.afifi@cloudsolution-sa.com';
|
|
|
|
|
user.PatientName = 'rwaid al mallah';
|
|
|
|
|
this.authService.updateLoggedInUser(user).subscribe(done => {
|
|
|
|
|
this.authService.startIdleMonitoring();
|
|
|
|
|
this.cs.openHome();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public loginWithTamer() {
|
|
|
|
|
alert('you are doing slient login width tamer account');
|
|
|
|
|
|
|
|
|
|
const user = new AuthenticatedUser();
|
|
|
|
|
user.PatientID = 1231755;
|
|
|
|
|
user.PatientTypeID = PATIENT_TYPE.PERMANENT;
|
|
|
|
|
user.ProjectID = 0;
|
|
|
|
|
user.PatientOutSA = false;
|
|
|
|
|
user.TokenID = '@dm!n';
|
|
|
|
|
user.NationalityID = '1001242559';
|
|
|
|
|
user.MobileNo = user.MobileNumber = '537503378';
|
|
|
|
|
user.ZipCode = '+966';
|
|
|
|
|
user.Address = 'riyadh';
|
|
|
|
|
user.FirstName = 'tamer';
|
|
|
|
|
user.MiddleName = 'faneshah';
|
|
|
|
|
user.LastName = 'faneshah';
|
|
|
|
|
user.Age = 30;
|
|
|
|
|
user.agreed = true;
|
|
|
|
|
const birthDate = new Date();
|
|
|
|
|
birthDate.setFullYear(birthDate.getFullYear() - 29);
|
|
|
|
|
user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate));
|
|
|
|
|
user.Email = 'mohamed.afifi@cloudsolution-sa.com';
|
|
|
|
|
user.PatientName = 'tamer fneshah';
|
|
|
|
|
this.authService.updateLoggedInUser(user).subscribe(done => {
|
|
|
|
|
this.authService.startIdleMonitoring();
|
|
|
|
|
this.cs.openHome();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// public loginWithRwaid() {
|
|
|
|
|
// alert('you are doing slient login width mr: rwaid account');
|
|
|
|
|
|
|
|
|
|
// const user = new AuthenticatedUser();
|
|
|
|
|
// // tamer with eye measurments 1231755
|
|
|
|
|
// user.PatientID = 1018977;
|
|
|
|
|
// user.PatientTypeID = PATIENT_TYPE.PERMANENT;
|
|
|
|
|
// user.ProjectID = 0;
|
|
|
|
|
// user.PatientOutSA = false;
|
|
|
|
|
// user.TokenID = '@dm!n';
|
|
|
|
|
// user.NationalityID = '1001242559';
|
|
|
|
|
// user.MobileNo = user.MobileNumber = '545156035';
|
|
|
|
|
// user.ZipCode = '+966';
|
|
|
|
|
// user.Address = 'riyadh';
|
|
|
|
|
// user.FirstName = 'rwaid';
|
|
|
|
|
// user.MiddleName = 'el mallah';
|
|
|
|
|
// user.LastName = 'mohammed';
|
|
|
|
|
// user.Age = 30;
|
|
|
|
|
// user.agreed = true;
|
|
|
|
|
// const birthDate = new Date();
|
|
|
|
|
// birthDate.setFullYear(birthDate.getFullYear() - 29);
|
|
|
|
|
// user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate));
|
|
|
|
|
// user.Email = 'mohamed.afifi@cloudsolution-sa.com';
|
|
|
|
|
// user.PatientName = 'rwaid al mallah';
|
|
|
|
|
// this.authService.updateLoggedInUser(user).subscribe(done => {
|
|
|
|
|
// this.authService.startIdleMonitoring();
|
|
|
|
|
// this.cs.openHome();
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// public loginWithTamer() {
|
|
|
|
|
// alert('you are doing slient login width tamer account');
|
|
|
|
|
|
|
|
|
|
// const user = new AuthenticatedUser();
|
|
|
|
|
// user.PatientID = 1231755;
|
|
|
|
|
// user.PatientTypeID = PATIENT_TYPE.PERMANENT;
|
|
|
|
|
// user.ProjectID = 0;
|
|
|
|
|
// user.PatientOutSA = false;
|
|
|
|
|
// user.TokenID = '@dm!n';
|
|
|
|
|
// user.NationalityID = '1001242559';
|
|
|
|
|
// user.MobileNo = user.MobileNumber = '537503378';
|
|
|
|
|
// user.ZipCode = '+966';
|
|
|
|
|
// user.Address = 'riyadh';
|
|
|
|
|
// user.FirstName = 'tamer';
|
|
|
|
|
// user.MiddleName = 'faneshah';
|
|
|
|
|
// user.LastName = 'faneshah';
|
|
|
|
|
// user.Age = 30;
|
|
|
|
|
// user.agreed = true;
|
|
|
|
|
// const birthDate = new Date();
|
|
|
|
|
// birthDate.setFullYear(birthDate.getFullYear() - 29);
|
|
|
|
|
// user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate));
|
|
|
|
|
// user.Email = 'mohamed.afifi@cloudsolution-sa.com';
|
|
|
|
|
// user.PatientName = 'tamer fneshah';
|
|
|
|
|
// this.authService.updateLoggedInUser(user).subscribe(done => {
|
|
|
|
|
// this.authService.startIdleMonitoring();
|
|
|
|
|
// this.cs.openHome();
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -360,13 +359,12 @@ export class LoginComponent implements OnInit, OnDestroy {
|
|
|
|
|
request.P_USER_NAME = this.username;
|
|
|
|
|
request.P_LANGUAGE = this.language;
|
|
|
|
|
request.P_PASSWORD = this.password;
|
|
|
|
|
console.log(request);
|
|
|
|
|
|
|
|
|
|
this.authService.checkUserAuthentication(
|
|
|
|
|
request,
|
|
|
|
|
() => {
|
|
|
|
|
}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
|
|
|
|
|
if (this.cs.validResponse(result)) {
|
|
|
|
|
console.log(result);
|
|
|
|
|
if (this.cs.validResponse(result)) {
|
|
|
|
|
this.loginData.LogInTokenID = result.LogInTokenID;
|
|
|
|
|
this.sharedData.setSharedData(this.loginData, "logindata");
|
|
|
|
|
this.cs.openSMSPage();
|
|
|
|
|
@ -438,11 +436,11 @@ export class LoginComponent implements OnInit, OnDestroy {
|
|
|
|
|
private checkIfUserAgreedBefore(result: CheckActivationCodeResponse) {
|
|
|
|
|
|
|
|
|
|
this.authService.setAuthenticatedUser(result).subscribe(() => {
|
|
|
|
|
if (this.authService.isAgreedBefore()) {
|
|
|
|
|
this.cs.openHome();
|
|
|
|
|
} else {
|
|
|
|
|
// this.cs.openAgreement();
|
|
|
|
|
}
|
|
|
|
|
// if (this.authService.isAgreedBefore()) {
|
|
|
|
|
// this.cs.openHome();
|
|
|
|
|
// } else {
|
|
|
|
|
// // this.cs.openAgreement();
|
|
|
|
|
// }
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|