- Password Modify Complete
+
+
+
+
+
+
+
+
+
+
+
+
+ 패스워드 변경이 완료 되었습니다.
+
+
+ 입력하신 패스워드로 변경 되었으며,
+ 로그인 페이지로 이동 후 변경된 패스워드로 로그인을 하시면 됩니다.
+ 버튼 클릭 시 로그인 페이지로 이동 합니다.
+
+
+
+
+
+
+ |
+
+
+
diff --git a/@overflow/member/component/member-modify-password.component.ts b/@overflow/member/component/member-modify-password.component.ts
index 144ce9c..6ab0839 100644
--- a/@overflow/member/component/member-modify-password.component.ts
+++ b/@overflow/member/component/member-modify-password.component.ts
@@ -1,16 +1,26 @@
import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
import {FormGroup, FormBuilder, Validators, FormControl, ValidationErrors, AbstractControl} from '@angular/forms';
-import {Member} from '@overflow/commons-typescript/model/member';
+import { Member } from '@overflow/commons-typescript/model/member';
+import { Store, select } from '@ngrx/store';
+import { Observable, of } from 'rxjs';
+import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
+
+import { MemberService } from '../service/member.service';
+
@Component({
selector: 'of-member-modify-password',
templateUrl: './member-modify-password.component.html',
})
export class MemberModifyPasswordComponent implements OnInit {
- @Input() token: string;
- @Input() member: Member;
+ member$: Observable
;
+ pending$: Observable;
+ error$: Observable;
- @Output() modifyPassword = new EventEmitter<{token: string, password: string, confirmPassword: string}>();
+ @Input() token: string;
+ // @Input() member: Member;
+
+ // @Output() modifyPassword = new EventEmitter<{token: string, password: string, confirmPassword: string}>();
@Output() signin = new EventEmitter();
modifyPasswordForm: FormGroup;
@@ -18,7 +28,9 @@ export class MemberModifyPasswordComponent implements OnInit {
pwConfirm: AbstractControl;
constructor(
+ private store: Store,
private formBuilder: FormBuilder,
+ private memberService: MemberService,
) { }
ngOnInit() {
@@ -63,7 +75,23 @@ export class MemberModifyPasswordComponent implements OnInit {
modifyPasswordFormSubmit() {
const formValue = Object.assign({}, this.modifyPasswordForm.value);
- this.modifyPassword.emit({token: this.token, password: formValue.pw, confirmPassword: formValue.confirmPw});
+ // this.modifyPassword.emit({token: this.token, password: formValue.pw, confirmPassword: formValue.confirmPw});
+ this.memberService.resetPassword(this.token, formValue.password, formValue.pwConfirm)
+ .pipe(
+ tap(() => {
+ this.pending$ = of(true);
+ }),
+ map((rmember: Member) => {
+ this.member$ = of(rmember);
+ }),
+ catchError( err => {
+ this.error$ = of(err);
+ return of();
+ }),
+ tap(() => {
+ this.pending$ = of(false);
+ }),
+ ).take(1).subscribe();
}
onSignin() {
diff --git a/@overflow/member/component/member-reset-password.component.html b/@overflow/member/component/member-reset-password.component.html
index b5a27b0..6fb94d5 100644
--- a/@overflow/member/component/member-reset-password.component.html
+++ b/@overflow/member/component/member-reset-password.component.html
@@ -1,45 +1,86 @@
-
-
- I sent an authentication mail to the mail address you registered. Please check and change your password.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 패스워드 변경이 신청 되었습니다.
+
+
+ 입력하신 이메일로 인증 메일이 발송 되었습니다.
+ 받으신 메일을 확인 하시고, 인증을 완료 하시면 패스워드 변경페이지로 이동 후 변경이 가능합니다.
+ 신청하신 이메일 주소는 {{member.email}} 입니다.
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
diff --git a/@overflow/member/component/member-reset-password.component.ts b/@overflow/member/component/member-reset-password.component.ts
index 00ab882..2738bec 100644
--- a/@overflow/member/component/member-reset-password.component.ts
+++ b/@overflow/member/component/member-reset-password.component.ts
@@ -10,24 +10,34 @@ import {
Validators,
AbstractControl
} from '@angular/forms';
+import { Store, select } from '@ngrx/store';
+import { Observable, of } from 'rxjs';
+import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
+
import {Member} from '@overflow/commons-typescript/model/member';
+import {MemberService} from '../service/member.service';
@Component({
selector: 'of-member-reset-password',
templateUrl: './member-reset-password.component.html',
})
export class MemberResetPasswordComponent implements OnInit {
- @Output() resetPassword = new EventEmitter();
+ // @Output() resetPassword = new EventEmitter();
@Output() signin = new EventEmitter();
@Output() signup = new EventEmitter();
- @Input() member: Member;
+ // @Input() member: Member;
+ member$: Observable;
+ pending$: Observable;
+ error$: Observable;
resetPasswordForm: FormGroup;
email: AbstractControl;
constructor(
- private formBuilder: FormBuilder
+ private store: Store,
+ private formBuilder: FormBuilder,
+ private memberService: MemberService,
) {
}
@@ -45,7 +55,23 @@ export class MemberResetPasswordComponent implements OnInit {
resetPasswordSubmit() {
const formValue = Object.assign({}, this.resetPasswordForm.value);
- this.resetPassword.emit(formValue.email);
+ // this.resetPassword.emit(formValue.email);
+ this.memberService.sendEmailResetPassword(formValue.email)
+ .pipe(
+ tap(() => {
+ this.pending$ = of(true);
+ }),
+ map((rmember: Member) => {
+ this.member$ = of(rmember);
+ }),
+ catchError( err => {
+ this.error$ = of(err);
+ return of();
+ }),
+ tap(() => {
+ this.pending$ = of(false);
+ }),
+ ).take(1).subscribe();
}
onSignin() {
@@ -55,4 +81,5 @@ export class MemberResetPasswordComponent implements OnInit {
onSignup() {
this.signup.emit();
}
+
}
diff --git a/@overflow/member/component/member-signup.component.html b/@overflow/member/component/member-signup.component.html
index e8708f2..4f53b26 100644
--- a/@overflow/member/component/member-signup.component.html
+++ b/@overflow/member/component/member-signup.component.html
@@ -17,7 +17,8 @@
-
+
+