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 595f862a..eae6c147 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 @@ -16,7 +16,8 @@ import { DialogService, ConfirmDialogComponent, ConfirmDialogData, - ConfirmDialogResult + ConfirmDialogResult, + SnackBarService } from '@ucap-webmessenger/ui'; import { @@ -362,6 +363,40 @@ export class Effects { ) ); + userPasswordSetSuccess$ = createEffect( + () => { + return this.actions$.pipe( + ofType(userPasswordSetSuccess), + tap(action => { + this.snackBarService.open(`비밀번호 변경이 완료 되었습니다`, '', { + duration: 3000, + verticalPosition: 'bottom' + }); + }) + ); + }, + { dispatch: false } + ); + + userPasswordSetFailure$ = createEffect( + () => { + return this.actions$.pipe( + ofType(userPasswordSetFailure), + tap(action => { + this.snackBarService.open( + `비밀번호 변경 중에 문제가 발생하였습니다.`, + '', + { + duration: 3000, + verticalPosition: 'bottom' + } + ); + }) + ); + }, + { dispatch: false } + ); + constructor( private actions$: Actions, private ngZone: NgZone, @@ -374,6 +409,7 @@ export class Effects { private authenticationProtocolService: AuthenticationProtocolService, private serviceProtocolService: ServiceProtocolService, private dialogService: DialogService, + private snackBarService: SnackBarService, @Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService, private logger: NGXLogger ) {} diff --git a/projects/ucap-webmessenger-ui-account/src/lib/components/change-password.component.ts b/projects/ucap-webmessenger-ui-account/src/lib/components/change-password.component.ts index fd07a6a9..a881111d 100644 --- a/projects/ucap-webmessenger-ui-account/src/lib/components/change-password.component.ts +++ b/projects/ucap-webmessenger-ui-account/src/lib/components/change-password.component.ts @@ -147,8 +147,10 @@ export class ChangePasswordComponent implements OnInit { onClickChangePassword() { this.changePassword.emit({ - currentLoginPw: this.currentLoginPwFormControl.value, - newLoginPw: this.newLoginPwFormControl.value + currentLoginPw: PasswordUtil.encrypt( + this.currentLoginPwFormControl.value + ), + newLoginPw: PasswordUtil.encrypt(this.newLoginPwFormControl.value) }); } } diff --git a/projects/ucap-webmessenger-ui/src/lib/services/snack-bar.service.spec.ts b/projects/ucap-webmessenger-ui/src/lib/services/snack-bar.service.spec.ts index 97fb5eb4..14afffd2 100644 --- a/projects/ucap-webmessenger-ui/src/lib/services/snack-bar.service.spec.ts +++ b/projects/ucap-webmessenger-ui/src/lib/services/snack-bar.service.spec.ts @@ -1,12 +1,12 @@ import { TestBed } from '@angular/core/testing'; -import { BottomSheetService } from './bottom-sheet.service'; +import { SnackBarService } from './snack-bar.service'; -describe('ui::BottomSheetService', () => { +describe('ui::SnackBarService', () => { beforeEach(() => TestBed.configureTestingModule({})); it('should be created', () => { - const service: BottomSheetService = TestBed.get(BottomSheetService); + const service: SnackBarService = TestBed.get(SnackBarService); expect(service).toBeTruthy(); }); });