diff --git a/Mohem/src/app/authentication/forgot/forgot.component.ts b/Mohem/src/app/authentication/forgot/forgot.component.ts index 95c8789f..8e76d97a 100644 --- a/Mohem/src/app/authentication/forgot/forgot.component.ts +++ b/Mohem/src/app/authentication/forgot/forgot.component.ts @@ -35,8 +35,7 @@ export class ForgotComponent implements OnInit { ) { } - ngOnInit() { - } + ngOnInit() {} public onForgot() { this.sendSMSForForgotPassword(); @@ -59,12 +58,18 @@ export class ForgotComponent implements OnInit { public forgotpassword(){ const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); + const forgetPasswordTokenResult = this.sharedData.getSharedData('checkSMSResponse', false); + let forgetPasswordTokenID = ''; + if (forgetPasswordTokenResult.ForgetPasswordTokenID) { + forgetPasswordTokenID = forgetPasswordTokenResult.ForgetPasswordTokenID; + } this.loginData.P_USER_NAME = this.P_USER_NAME; - let request:ForgetPassword = new ForgetPassword(); + let request: any = {}; request.P_Confirm_NEW_PASSWORD=this.P_NEW_PASSWORD; request.P_NEW_PASSWORD=this.P_Confirm_NEW_PASSWORD; request.P_USER_NAME = data.P_USER_NAME; - + request.ForgetPasswordTokenID = forgetPasswordTokenID; + this.authService.submitForgetPassword( request, () => { diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.ts b/Mohem/src/app/authentication/sms-page/sms-page.page.ts index 69778fb6..1be921ed 100644 --- a/Mohem/src/app/authentication/sms-page/sms-page.page.ts +++ b/Mohem/src/app/authentication/sms-page/sms-page.page.ts @@ -252,6 +252,7 @@ export class SmsPageComponent implements OnInit { request.P_USER_NAME = data.P_USER_NAME; this.authService.checkForgetSMS(request, () => {}, this.translate.trPK('general', 'ok')).subscribe((result: SMSCheckResponse) => { if (this.common.validResponse(result)) { + this.sharedData.setSharedData(result, 'checkSMSResponse'); if (this.isForgetPwd) { this.common.openForgotPassword(); } diff --git a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts index 09c1e993..9952d38e 100644 --- a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts +++ b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts @@ -142,7 +142,7 @@ export class AuthenticationService { } else { mobileType = 'android'; } - request.VersionID = 2.9; + request.VersionID = 3.0; request.Channel = 31; request.LanguageID = TranslatorService.getCurrentLanguageCode(); request.MobileType = mobileType; diff --git a/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts b/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts index 73d27b74..c6332dba 100644 --- a/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts +++ b/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts @@ -21,5 +21,5 @@ export class SMSCheckResponse extends Response { public EMPLOYEE_NAME:string; public Mohemm_Wifi_SSID:string; public Mohemm_Wifi_Password:string; - + public ForgetPasswordTokenID: string; }