diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index a2ab328..94fa059 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -28,7 +28,7 @@ export const routes: Routes = [ { path: 'login/notice/:id', component: LoginComponent }, { path: 'register', component: RegisterComponent }, { path: 'forgot-pw', component: ForgotPwComponent }, - { path: 'pw-reset/:uid/:token', component: PwResetComponent }, + { path: 'pw-reset/:uidb64/:token', component: PwResetComponent }, { path: 'login/imprint', component: ImprintComponent }, { path: 'login/privacy-policy', component: PrivacyPolicyComponent }, ], @@ -51,4 +51,5 @@ export const routes: Routes = [ { path: 'privacy-policy', component: PrivacyPolicyComponent }, ], }, + { path: '**', component: LoginComponent }, ]; diff --git a/src/app/components/login/forgot-pw/forgot-pw.component.ts b/src/app/components/login/forgot-pw/forgot-pw.component.ts index 83282db..83094bc 100644 --- a/src/app/components/login/forgot-pw/forgot-pw.component.ts +++ b/src/app/components/login/forgot-pw/forgot-pw.component.ts @@ -34,13 +34,15 @@ export class ForgotPwComponent { private authService: AuthService ) {} - onSubmit(ngForm: NgForm) { + async onSubmit(ngForm: NgForm) { this.buttonStateService.disableButton(); if (ngForm.submitted && ngForm.form.valid) { try { - this.authService.resetPassword(this.pwResetData.mail.toLowerCase()); + await this.authService.resetPassword( + this.pwResetData.mail.toLowerCase() + ); this.buttonStateService.enableButton(); - } catch (error: any) { + } catch (error) { this.buttonStateService.enableButton(); } } else { diff --git a/src/app/components/login/forgot-pw/pw-reset/pw-reset.component.scss b/src/app/components/login/forgot-pw/pw-reset/pw-reset.component.scss index 17c0977..b8cffa6 100644 --- a/src/app/components/login/forgot-pw/pw-reset/pw-reset.component.scss +++ b/src/app/components/login/forgot-pw/pw-reset/pw-reset.component.scss @@ -67,18 +67,25 @@ section { top: 102px; } } - .passwordEye { - position: absolute; - right: -5px; - top: 15px; - cursor: pointer; - } + + .passwordEye, .passwordEyeConfirm { position: absolute; right: -5px; - top: 102px; + top: 15px; + transition: filter 0.3s ease; cursor: pointer; + + &:hover { + filter: brightness(0) saturate(100%) invert(53%) sepia(83%) saturate(480%) + hue-rotate(155deg) brightness(94%) contrast(88%); + } } + + .passwordEyeConfirm { + top: 102px; + } + .custom-input:focus + .custom-img { display: none; } diff --git a/src/app/components/login/forgot-pw/pw-reset/pw-reset.component.ts b/src/app/components/login/forgot-pw/pw-reset/pw-reset.component.ts index 00e6d21..2f38432 100644 --- a/src/app/components/login/forgot-pw/pw-reset/pw-reset.component.ts +++ b/src/app/components/login/forgot-pw/pw-reset/pw-reset.component.ts @@ -26,7 +26,7 @@ import { PasswordVisibilityService } from '../../../../services/password-visibil styleUrl: './pw-reset.component.scss', }) export class PwResetComponent implements OnInit, OnDestroy { - uid: string = ''; + uidb64: string = ''; token: string = ''; errorHttpMessage: string = ''; @@ -55,7 +55,7 @@ export class PwResetComponent implements OnInit, OnDestroy { routeParams() { this.route.params.pipe(takeUntil(this.destroy$)).subscribe((params) => { - this.uid = params['uid']; + this.uidb64 = params['uidb64']; this.token = params['token']; }); } @@ -68,9 +68,10 @@ export class PwResetComponent implements OnInit, OnDestroy { this.buttonStateService.disableButton(); if (ngForm.submitted && ngForm.form.valid) { try { + console.log(this.uidb64, this.token); await this.authService.resetPasswordConfirm( this.pwResetData.password, - this.uid, + this.uidb64, this.token ); this.buttonStateService.enableButton(); diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index cd3c68a..7f5844d 100755 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -83,17 +83,18 @@ export class AuthService { this.apiService.request('POST', `/auth/reset/`, { email }) ); this.toastNotificationService.resetPasswordSuccessToast(); + this.router.navigate(['/login']); } catch (error) { console.error('Password reset failed:', error); } } - async resetPasswordConfirm(password: string, uid: string, token: string) { + async resetPasswordConfirm(password: string, uidb64: string, token: string) { try { await lastValueFrom( this.apiService.request('POST', `/auth/reset/confirm/`, { password, - uid, + uidb64, token, }) );