diff --git a/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts b/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts index 4ec1c3f2..867b1918 100644 --- a/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts @@ -47,7 +47,8 @@ import { LoginInfo, KEY_LOGIN_INFO, EnvironmentsInfo, - KEY_ENVIRONMENTS_INFO + KEY_ENVIRONMENTS_INFO, + KEY_URL_INFO } from '@app/types'; import { AppAuthenticationService } from '@app/services/authentication.service'; import { NGXLogger } from 'ngx-logger'; @@ -71,6 +72,7 @@ import { ServiceProtocolService, UserPasswordSetResponse } from '@ucap-webmessenger/protocol-service'; +import { DaesangUrlInfoResponse } from '@ucap-webmessenger/api-external'; @Injectable() export class Effects { @@ -287,35 +289,62 @@ export class Effects { } if (!loginRes.passwordValid) { - const result = await this.dialogService.open< - ChangePasswordDialogComponent, - ChangePasswordDialogData, - ChangePasswordDialogResult - >(ChangePasswordDialogComponent, { - width: '500px', - height: '500px', - disableClose: false, + // [Daesang] + const urlInfo: DaesangUrlInfoResponse = this.sessionStorageService.get< + DaesangUrlInfoResponse + >(KEY_URL_INFO); + + await this.dialogService.open< + AlertDialogComponent, + AlertDialogData, + AlertDialogResult + >(AlertDialogComponent, { data: { - loginId: loginInfo.loginId, - encryptedLoginPw: loginInfo.loginPw, - phoneNumber: loginRes.userInfo.hpNumber + title: '비밀번호 만기', + html: `비밀번호가 만료되었습니다.
비밀번호 변경 후 다시 로그인 하세요.` } }); - if (!!result && result.choice) { - this.store.dispatch( - userPasswordSet({ - req: { - companyCode: loginInfo.companyCode, - loginId: loginInfo.loginId, - oldLoginPw: result.currentLoginPw, - newLoginPw: result.newLoginPw - } - }) - ); - } else { - return; + const passwordChangeUrl = urlInfo.webLink.filter( + weblink => weblink.key === 'WebLinkChgPassword' + ); + if (passwordChangeUrl.length > 0) { + this.nativeService.openDefaultBrowser(passwordChangeUrl[0].url); } + + this.store.dispatch(logout()); + + // // [GROUP] + // const result = await this.dialogService.open< + // ChangePasswordDialogComponent, + // ChangePasswordDialogData, + // ChangePasswordDialogResult + // >(ChangePasswordDialogComponent, { + // width: '500px', + // height: '500px', + // disableClose: false, + // data: { + // loginId: loginInfo.loginId, + // encryptedLoginPw: loginInfo.loginPw, + // phoneNumber: loginRes.userInfo.hpNumber + // } + // }); + + // if (!!result && result.choice) { + // this.store.dispatch( + // userPasswordSet({ + // req: { + // companyCode: loginInfo.companyCode, + // loginId: loginInfo.loginId, + // oldLoginPw: result.currentLoginPw, + // newLoginPw: result.newLoginPw + // } + // }) + // ); + // } else { + // this.store.dispatch(logout()); + // return; + // } } }) ),