diff --git a/Mohem/src/app/authentication/authentication.module.ts b/Mohem/src/app/authentication/authentication.module.ts index c1551cb3..80456df0 100644 --- a/Mohem/src/app/authentication/authentication.module.ts +++ b/Mohem/src/app/authentication/authentication.module.ts @@ -18,6 +18,7 @@ import { MobileNumberModule } from 'src/app/hmg-common/ui/mobile-number/mobile- import { SmsdialogPageModule } from 'src/app/hmg-common/ui/smsdialog/smsdialog.module'; import { SmsPageModule } from 'src/app/hmg-common/ui/sms/sms.module'; import { SmsPagePage } from './sms-page/sms-page.page'; +import { CheckUserComponent } from './check-user/check-user.component'; @@ -41,6 +42,10 @@ const routes: Routes = [ { path: 'smspage', component: SmsPagePage + }, + { + path: 'checkuser', + component: CheckUserComponent } ] } @@ -65,7 +70,8 @@ const routes: Routes = [ LoginComponent, ForgotComponent, AgreementComponent, - SmsPagePage + SmsPagePage, + CheckUserComponent ], providers:[ FingerprintAIO, diff --git a/Mohem/src/app/authentication/check-user/check-user.component.html b/Mohem/src/app/authentication/check-user/check-user.component.html new file mode 100644 index 00000000..40ce8b47 --- /dev/null +++ b/Mohem/src/app/authentication/check-user/check-user.component.html @@ -0,0 +1,33 @@ + + + + + + {{'login,forgot-password' | translate}} + + + + + + + + + + + + {{ts.trPK('login','username')}} + + + + + + + + + + + +
+ {{ts.trPK('login','changepassword')}} +
+
\ No newline at end of file diff --git a/Mohem/src/app/authentication/check-user/check-user.component.scss b/Mohem/src/app/authentication/check-user/check-user.component.scss new file mode 100644 index 00000000..4357e11d --- /dev/null +++ b/Mohem/src/app/authentication/check-user/check-user.component.scss @@ -0,0 +1,7 @@ +.header-toolbar{ + --background: linear-gradient(45deg, #3ac1f1 0%, #19a163 36%, #19a163 59%, #1a586d 100%); +} + +.btnBack{ + background: transparent; +} \ No newline at end of file diff --git a/Mohem/src/app/authentication/check-user/check-user.component.spec.ts b/Mohem/src/app/authentication/check-user/check-user.component.spec.ts new file mode 100644 index 00000000..b1d86516 --- /dev/null +++ b/Mohem/src/app/authentication/check-user/check-user.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CheckUserComponent } from './check-user.component'; + +describe('CheckUserComponent', () => { + let component: CheckUserComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CheckUserComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CheckUserComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/authentication/check-user/check-user.component.ts b/Mohem/src/app/authentication/check-user/check-user.component.ts new file mode 100644 index 00000000..b510b256 --- /dev/null +++ b/Mohem/src/app/authentication/check-user/check-user.component.ts @@ -0,0 +1,98 @@ +import { Component, OnInit, ViewChild, ChangeDetectorRef, OnDestroy } from '@angular/core'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; +import { Router } from '@angular/router'; +import { AlertController } from '@ionic/angular'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { CheckUserAuthenticationRequest } from 'src/app/hmg-common/services/authentication/models/check-user-auth.request'; +import { CheckUserAuthenticationResponse } from 'src/app/hmg-common/services/authentication/models/check-user-auth.response'; +import { CheckActivationCodeRequest } from 'src/app/hmg-common/services/authentication/models/check-activation-code.request'; +import { SmsReaderService } from 'src/app/hmg-common/services/sms/sms-reader.service'; +import { ForgotFileIDResponse } from '../../hmg-common/services/authentication/models/forgot-File-ID.response'; +import { InternationalMobileComponent } from 'src/app/hmg-common/ui/mobile-number/international-mobile/international-mobile.component'; +import { CountryCode } from 'src/app/hmg-common/ui/mobile-number/international-mobile/models/country-code.model'; +import { LoginRequest } from 'src/app/hmg-common/services/authentication/models/login.request'; +import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; +import { Password } from '../models/password'; +import { LoginModel } from '../models/LoginModel'; + +@Component({ + selector: 'app-check-user', + templateUrl: './check-user.component.html', + styleUrls: ['./check-user.component.scss'], +}) +export class CheckUserComponent implements OnInit,OnDestroy { + public P_USER_NAME : string; + private loginData = new LoginModel(); + + @ViewChild(InternationalMobileComponent) internationlMobile: InternationalMobileComponent; + constructor(public cs: CommonService, + public authService: AuthenticationService, + public router: Router, + public alertController: AlertController, + public ts: TranslatorService, + public smsService: SmsReaderService, + public sharedData: SharedDataService, + public changeDetector: ChangeDetectorRef) { } + + ngOnInit() {} + + ngOnDestroy(): void { + this.smsService.stopSMSMonitoring(); + } + + public onForgot() { + this.sendSMSForForgotPassword(); + } + + public userCheck() + { + this.cs.startLoading(); + const request = new CheckUserAuthenticationRequest(); + request.P_USER_NAME = this.P_USER_NAME; + this.authService.checkUserAuthentication( + request, + () => { + //this.sendSMSForForgotPassword(); + }, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => { + if (this.cs.validResponse(result)) { + this.checkUserResult = result; + this.cs.stopLoading(); + this.sendSMSForForgotPassword(); + + // if (result.isSMSSent) { + // this.startReceivingSMS(); + // this.presentSMSPasswordDialog(); + // } + } + }); + } + + private checkUserResult: CheckUserAuthenticationResponse; + + private sendSMSForForgotPassword() { + this.cs.startLoading(); + let changePwdObj= new LoginRequest(); + changePwdObj.MobileNumber= this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER; + changePwdObj.P_USER_NAME=this.P_USER_NAME; + changePwdObj.P_MOBILE_NUMBER=this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER; + + this.authService.sendPublicSMS( + changePwdObj, + () => { + this.sendSMSForForgotPassword(); + }, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => { + if (this.cs.validResponse(result)) { + this.checkUserResult = result; + console.log("2"); + console.log(result); + this.loginData.LogInTokenID = result.LogInTokenID; + this.loginData.P_USER_NAME = this.P_USER_NAME; + this.sharedData.setSharedData(this.loginData, "logindata"); + this.sharedData.setSharedData(true,Password.IS_FORGET_PSW); + this.cs.stopLoading(); + this.cs.openSMSPage(); + }}); + } +} + diff --git a/Mohem/src/app/authentication/forgot/forgot.component.html b/Mohem/src/app/authentication/forgot/forgot.component.html index 1bc60365..9e46cdb7 100644 --- a/Mohem/src/app/authentication/forgot/forgot.component.html +++ b/Mohem/src/app/authentication/forgot/forgot.component.html @@ -12,14 +12,21 @@ - - - - {{ts.trPK('login','username')}} - - - - + + + {{'changePassword,newPassword' | translate}} + + + + + + + {{'changePassword,confirmPassword' | translate}} + + + @@ -28,6 +35,6 @@
- {{ts.trPK('login','changepassword')}} -
+ {{ts.trPK('login','changepassword')}} +
\ No newline at end of file diff --git a/Mohem/src/app/authentication/forgot/forgot.component.ts b/Mohem/src/app/authentication/forgot/forgot.component.ts index 949f40a2..3cbe099a 100644 --- a/Mohem/src/app/authentication/forgot/forgot.component.ts +++ b/Mohem/src/app/authentication/forgot/forgot.component.ts @@ -11,7 +11,9 @@ import { SmsReaderService } from 'src/app/hmg-common/services/sms/sms-reader.ser import { ForgotFileIDResponse } from '../../hmg-common/services/authentication/models/forgot-File-ID.response'; import { InternationalMobileComponent } from 'src/app/hmg-common/ui/mobile-number/international-mobile/international-mobile.component'; import { CountryCode } from 'src/app/hmg-common/ui/mobile-number/international-mobile/models/country-code.model'; - +import { ForgetPassword } from '../models/forget.password'; +import { LoginModel } from '../models/LoginModel'; +import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; @Component({ selector: 'app-forgot', @@ -20,7 +22,10 @@ import { CountryCode } from 'src/app/hmg-common/ui/mobile-number/international-m }) export class ForgotComponent implements OnInit,OnDestroy { - public countryCode: CountryCode; + private loginData = new LoginModel(); + public P_NEW_PASSWORD: string; + public P_Confirm_NEW_PASSWORD : string; + public P_USER_NAME : string; @ViewChild(InternationalMobileComponent) internationlMobile: InternationalMobileComponent; constructor( public cs: CommonService, @@ -29,7 +34,8 @@ export class ForgotComponent implements OnInit,OnDestroy { public alertController: AlertController, public ts: TranslatorService, public smsService: SmsReaderService, - public changeDetector: ChangeDetectorRef + public changeDetector: ChangeDetectorRef, + public sharedData: SharedDataService ) { } @@ -39,77 +45,49 @@ export class ForgotComponent implements OnInit,OnDestroy { ngOnDestroy(): void { this.smsService.stopSMSMonitoring(); } + public onForgot() { this.sendSMSForForgotPassword(); } - - public countryCodeChanged(countryCode: CountryCode) { - this.countryCode = countryCode; - } - - public isValidForm() { - return (this.countryCode && this.countryCode.isValid); - } - - - private checkUserResult: CheckUserAuthenticationResponse; private sendSMSForForgotPassword() { - const request = new CheckUserAuthenticationRequest(); + const request = new ForgetPassword(); //request.PatientMobileNumber = this.countryCode.number; //request.ZipCode = CountryCode.localCode(this.countryCode.code); - - this.authService.sendSMSForForgotFileNumber( + this.authService.sendForgetPassword( request, () => { this.sendSMSForForgotPassword(); }, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => { if (this.cs.validResponse(result)) { this.checkUserResult = result; - if (result.isSMSSent) { - this.startReceivingSMS(); - this.presentSMSPasswordDialog(); - } } }); } - - private startReceivingSMS() { - this.smsService.startSMSMonitoring((code) => { - this.cs.dismissSMSDialog().subscribe(cleared => { - this.checkActivationCode(code); - }); - }); - } - public presentSMSPasswordDialog() { - this.cs.presentSMSPasswordDialog( - (code: string) => { - this.checkActivationCode(code); - }); - } - - private checkActivationCode(readedCode?) { - const request = new CheckActivationCodeRequest(); - request.LogInTokenID = this.checkUserResult.LogInTokenID; - request.PatientOutSA = this.checkUserResult.PatientOutSA ? 1 : 0; - request.PatientMobileNumber = this.countryCode.number; - request.ZipCode = CountryCode.localCode(this.countryCode.code); - request.activationCode = readedCode; - - this.authService.forgotFileIdActivation(request, + public forgotpassword(){ + const data = this.sharedData.getSharedData("logindata", false); + this.loginData.P_USER_NAME = this.P_USER_NAME; + let request:ForgetPassword = new ForgetPassword(); + 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; + //console.log(request); + //request.P_USER_NAME = this.userName.P_USER_NAME; + this.authService.submitForgetPassword( + request, () => { - this.presentSMSPasswordDialog(); - }, this.ts.trPK('general', 'retry')).subscribe((result: ForgotFileIDResponse) => { + //this.sendSMSForForgotPassword(); + }, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => { if (this.cs.validResponse(result)) { - this.smsService.stopSMSMonitoring(); - this.cs.presentAlert(result.ReturnMessage); + this.checkUserResult = result; + console.log(result); + this.cs.toastPK("changePassword","passwordchanged"); + this.cs.openLogin(); } }); - + } - - } diff --git a/Mohem/src/app/authentication/login/login.component.ts b/Mohem/src/app/authentication/login/login.component.ts index d5e5bfde..09cb7398 100644 --- a/Mohem/src/app/authentication/login/login.component.ts +++ b/Mohem/src/app/authentication/login/login.component.ts @@ -17,6 +17,7 @@ import { Device } from '@ionic-native/device/ngx'; import { SplashScreen } from '@ionic-native/splash-screen/ngx'; import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; import { LoginModel } from '../models/LoginModel'; +import { LoginRequest } from 'src/app/hmg-common/services/authentication/models/login.request'; @Component({ selector: 'login', @@ -356,12 +357,12 @@ export class LoginComponent implements OnInit, OnDestroy { } private checkUserAuthentication() { - const request = new CheckUserAuthenticationRequest(); + const request = new LoginRequest(); request.P_USER_NAME = this.username; request.P_LANGUAGE = this.language; request.P_PASSWORD = this.password; console.log(request); - this.authService.checkUserAuthentication( + this.authService.login( request, () => { }, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => { diff --git a/Mohem/src/app/authentication/models/forget.password.ts b/Mohem/src/app/authentication/models/forget.password.ts new file mode 100644 index 00000000..b6cda129 --- /dev/null +++ b/Mohem/src/app/authentication/models/forget.password.ts @@ -0,0 +1,7 @@ +import { Request } from 'src/app/hmg-common/services/models/request'; +export class ForgetPassword extends Request { + public static IS_FORGET_PSW:string="is_forget_password"; + public P_NEW_PASSWORD: string; + public P_Confirm_NEW_PASSWORD:string; + public P_USER_NAME : string; +} diff --git a/Mohem/src/app/authentication/models/password.ts b/Mohem/src/app/authentication/models/password.ts new file mode 100644 index 00000000..4a160292 --- /dev/null +++ b/Mohem/src/app/authentication/models/password.ts @@ -0,0 +1,10 @@ +import { Request } from 'src/app/hmg-common/services/models/request'; + + +export class Password extends Request { + public static IS_FORGET_PSW:string="is_forget_password"; + public IS_FORGET_PWD:boolean; + public P_NEW_PASSWORD: string; + public P_OLD_PASSWORD:string; + public P_Confirm_NEW_PASSWORD:string; +} \ No newline at end of file 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 7a07a8aa..b28e7db6 100644 --- a/Mohem/src/app/authentication/sms-page/sms-page.page.ts +++ b/Mohem/src/app/authentication/sms-page/sms-page.page.ts @@ -8,6 +8,7 @@ import { SMSCheckRequest } from 'src/app/hmg-common/services/authentication/mode import { LoginModel } from '../models/LoginModel'; import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; import { SMSCheckResponse } from 'src/app/hmg-common/services/authentication/models/smscheck.response'; +import { Password } from '../models/password'; @Component({ @@ -44,6 +45,7 @@ export class SmsPagePage implements OnInit { this.count = 0; this.initTimer(); this.startTimer(); + this.isForgetPwd = this.sharedData.getSharedData(Password.IS_FORGET_PSW) || false; } @@ -126,7 +128,7 @@ export class SmsPagePage implements OnInit { request.activationCode =this.activationCode; //request.P_USER_NAME=this.userName, //request.MobileNumber=this.member.MemberLoginList.P_MOBILE_NUMBER - + console.log(data.LogInTokenID); this.authService.checkSMS( request, () => { @@ -143,7 +145,28 @@ export class SmsPagePage implements OnInit { public checkForgetPwdSMS() { + const data = this.sharedData.getSharedData("logindata", false); + const request = new SMSCheckRequest(); + + request.LogInTokenID= data.LogInTokenID, + request.activationCode =this.activationCode; + //request.P_USER_NAME=this.userName, + //request.MobileNumber=this.member.MemberLoginList.P_MOBILE_NUMBER + console.log(data.LogInTokenID); + this.authService.checkForgetSMS( + request, + () => { + }, this.translate.trPK('general', 'ok')).subscribe((result: SMSCheckResponse) => { + console.log(result); + if (this.common.validResponse(result)) { + console.log(result); + + //this.loginData.LogInTokenID = result.LogInTokenID; + //this.sharedData.setSharedData(this.loginData, "logindata"); + 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 f71a6117..292297ef 100644 --- a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts +++ b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts @@ -26,6 +26,7 @@ import { Events } from '@ionic/angular'; import { InternationalMobileComponent } from '../../ui/mobile-number/international-mobile/international-mobile.component'; import { SMSCheckRequest } from './models/smscheck.request'; import { SMSCheckResponse } from './models/smscheck.response'; +import { ForgetPassword } from 'src/app/authentication/models/forget.password'; @Injectable({ providedIn: 'root' @@ -58,6 +59,10 @@ export class AuthenticationService { public static forgotFileIDURL = 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo'; public static user: AuthenticatedUser; + /*user checking methods */ + public static userChecking = 'Services/ERP.svc/REST/Get_BasicUserInformation'; + public static changePasswordForget ='Services/ERP.svc/REST/ChangePassword_Forget'; + public static LOGIN_EVENT = 'user-login-event'; public static FAMILY_LOGIN_EVENT = 'family-login-event'; public static AUTHENTICATED_USER_KEY = 'save-authenticated-user'; @@ -156,11 +161,8 @@ export class AuthenticationService { public login(request: LoginRequest, onError: any, errorLabel: string): Observable { - request.PatientID = 0; - request.TokenID = ''; - request.isDentalAllowedBackend = false; - request.isRegister = false; - return this.con.post(AuthenticationService.loginURL, request, onError, errorLabel); + this.setPublicFields(request); + return this.con.post(AuthenticationService.login, request, onError, errorLabel); } @@ -430,7 +432,7 @@ export class AuthenticationService { public checkUserAuthentication(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string) : Observable { this.setPublicFields(request); - return this.con.post(AuthenticationService.login, request, onError, errorLabel); + return this.con.post(AuthenticationService.userChecking, request, onError, errorLabel); } public checkActivationCode(request: CheckActivationCodeRequest, onError: any, errorLabel: string) @@ -445,6 +447,18 @@ export class AuthenticationService { return this.con.post(AuthenticationService.smsCheck, request, onError, errorLabel); } + public checkForgetSMS(request: SMSCheckRequest, onError: any, errorLabel: string) + : Observable { + this.setPublicFields(request); + return this.con.post(AuthenticationService.smsCheckForget, request, onError, errorLabel); + } + + public sendPublicSMS(request: SMSCheckRequest, onError: any, errorLabel: string) + : Observable { + this.setPublicFields(request); + return this.con.post(AuthenticationService.smsSendCode, request, onError, errorLabel); + } + /* client side: id no , mobile no , zip code @@ -476,6 +490,19 @@ export class AuthenticationService { return this.con.post(AuthenticationService.activationCodeURL, request, onError, errorLabel); } + public sendForgetPassword(request: ForgetPassword, onError: any, errorLabel: string) + : Observable { + this.setPublicFields(request); + return this.con.post(AuthenticationService.smsSendCode, request, onError, errorLabel); + } + + public submitForgetPassword(request: ForgetPassword, onError: any, errorLabel: string) + : Observable { + this.setPublicFields(request); + return this.con.post(AuthenticationService.changePasswordForget, request, onError, errorLabel); + } + + public sendSMSForForgotFileNumber(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string) : Observable { this.setPublicFields(request); diff --git a/Mohem/src/app/hmg-common/services/authentication/models/basic.info.ts b/Mohem/src/app/hmg-common/services/authentication/models/basic.info.ts new file mode 100644 index 00000000..fc4a19a1 --- /dev/null +++ b/Mohem/src/app/hmg-common/services/authentication/models/basic.info.ts @@ -0,0 +1,7 @@ + +export class BasicInfo extends Request{ + public P_EMAIL_ADDRESS:string; + public P_MOBILE_NUMBER: string; + public P_RETURN_MSG: string; + public P_RETURN_STATUS: string; +} diff --git a/Mohem/src/app/hmg-common/services/authentication/models/check-user-auth.response.ts b/Mohem/src/app/hmg-common/services/authentication/models/check-user-auth.response.ts index e7e942f0..cc33d22d 100644 --- a/Mohem/src/app/hmg-common/services/authentication/models/check-user-auth.response.ts +++ b/Mohem/src/app/hmg-common/services/authentication/models/check-user-auth.response.ts @@ -1,4 +1,6 @@ import { Response } from '../../models/response'; +import { BasicInfo } from './basic.info'; +import { MemberList } from './member.list'; export class CheckUserAuthenticationResponse extends Response { PatientHasFile: boolean; @@ -10,4 +12,12 @@ export class CheckUserAuthenticationResponse extends Response { hasFile: boolean; isSMSSent: boolean; LogInTokenID: string; + P_EMAIL_ADDRESS : string; + P_MOBILE_NUMBER : string; + P_RETURN_MSG : string; + P_RETURN_STATUS : string; + public IsPasswordExpired: boolean; + //public P_SESSION_ID:string; + public MemberLoginList: MemberList ; + public BasicMemberInformation: BasicInfo; } diff --git a/Mohem/src/app/hmg-common/services/authentication/models/login.request.ts b/Mohem/src/app/hmg-common/services/authentication/models/login.request.ts index 5d6b3511..cb1cdbf5 100644 --- a/Mohem/src/app/hmg-common/services/authentication/models/login.request.ts +++ b/Mohem/src/app/hmg-common/services/authentication/models/login.request.ts @@ -7,6 +7,11 @@ export class LoginRequest extends Request { SearchType: number; // 1 for iqama 2 for file number TokenID: string; // "" ZipCode: string; // "966" + MobileNumber: string; + P_USER_NAME : string; + P_MOBILE_NUMBER : string; + P_PASSWORD : string; + P_LANGUAGE : string; // isDentalAllowedBackend: false isRegister: boolean; // false } diff --git a/Mohem/src/app/hmg-common/services/authentication/models/member.list.ts b/Mohem/src/app/hmg-common/services/authentication/models/member.list.ts new file mode 100644 index 00000000..e74b563f --- /dev/null +++ b/Mohem/src/app/hmg-common/services/authentication/models/member.list.ts @@ -0,0 +1,9 @@ +export class MemberList { + public P_EMAIL_ADDRESS:string; + public P_INVALID_LOGIN_MSG: string; + public P_MOBILE_NUMBER: string; + public P_PASSOWRD_EXPIRED: string; + public P_RETURN_MSG: string; + public P_RETURN_STATUS: string; + public P_SESSION_ID: number; +} \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts index e13d1fad..ac967af1 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -891,6 +891,9 @@ export class CommonService { public openHome() { this.alternateNavigate(CommonService.HOME_URL, "home-open", true); } + public openForgotPassword() { + this.nav.navigateForward(["/authentication/forgot"]); + } public reload(url: string, from: string) { console.log("force reload called from:" + from); @@ -930,9 +933,12 @@ export class CommonService { } } + public openLogin() { + this.nav.navigateRoot(["/authentication/login"]); + } public openUserForgot() { - this.nav.navigateForward(["/authentication/forgot"]); + this.nav.navigateForward(["/authentication/checkuser"]); } public openSMSPage() { this.nav.navigateForward(["/authentication/smspage"]); diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 3467ca8a..4f926ef5 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -90,6 +90,20 @@ "ar":"تحقق مرة واحدة كلمة المرور" } }, +"changePassword":{ + "newPassword":{ + "en":"New Password", + "ar":"كلمة المرور الجديدة" + }, + "confirmPassword":{ + "en":"Confirm Password", + "ar":"تأكيد كلمة المرور" + }, + "passwordchanged":{ + "en":"Your password changed successfully", + "ar":"تم تغيير كلمة المرور الخاصة بك بنجاح" + } +}, "verificationcode": { "verificationcode":{