@if (resetFormControls['confirmPassword'].errors?.['required']) {
-
+
Zurück zur Startseite
diff --git a/frontend/src/app/feature/auth/recover-password/recover-password.component.ts b/frontend/src/app/feature/auth/recover-password/recover-password.component.ts
index fc3a4d9..d1ad253 100644
--- a/frontend/src/app/feature/auth/recover-password/recover-password.component.ts
+++ b/frontend/src/app/feature/auth/recover-password/recover-password.component.ts
@@ -7,10 +7,7 @@ import { AuthService } from '@service/auth.service';
@Component({
selector: 'app-recover-password',
standalone: true,
- imports: [
- CommonModule,
- ReactiveFormsModule,
- ],
+ imports: [CommonModule, ReactiveFormsModule],
templateUrl: './recover-password.component.html',
})
export class RecoverPasswordComponent {
@@ -31,18 +28,21 @@ export class RecoverPasswordComponent {
private route: ActivatedRoute
) {
this.emailForm = this.fb.group({
- email: ['', [Validators.required, Validators.email]]
+ email: ['', [Validators.required, Validators.email]],
});
- this.resetPasswordForm = this.fb.group({
- password: ['', [Validators.required, Validators.minLength(8)]],
- confirmPassword: ['', [Validators.required]]
- }, {
- validators: this.passwordMatchValidator
- });
+ this.resetPasswordForm = this.fb.group(
+ {
+ password: ['', [Validators.required, Validators.minLength(8)]],
+ confirmPassword: ['', [Validators.required]],
+ },
+ {
+ validators: this.passwordMatchValidator,
+ }
+ );
// Check if we're in reset mode
- this.route.queryParamMap.subscribe(params => {
+ this.route.queryParamMap.subscribe((params) => {
const token = params.get('token');
if (token) {
this.token = token;
@@ -79,7 +79,9 @@ export class RecoverPasswordComponent {
this.authService.recoverPassword(email).subscribe({
next: () => {
this.isLoading.set(false);
- this.successMessage.set('Wenn ein Konto mit dieser E-Mail existiert, wird eine E-Mail mit weiteren Anweisungen gesendet.');
+ this.successMessage.set(
+ 'Wenn ein Konto mit dieser E-Mail existiert, wird eine E-Mail mit weiteren Anweisungen gesendet.'
+ );
this.emailForm.reset();
},
error: (err) => {
@@ -87,7 +89,7 @@ export class RecoverPasswordComponent {
this.errorMessage.set(
err.error?.message || 'Ein Fehler ist aufgetreten. Bitte versuche es später erneut.'
);
- }
+ },
});
}
@@ -105,7 +107,9 @@ export class RecoverPasswordComponent {
this.authService.resetPassword(this.token, password).subscribe({
next: () => {
this.isLoading.set(false);
- this.successMessage.set('Dein Passwort wurde erfolgreich zurückgesetzt. Du kannst dich jetzt anmelden.');
+ this.successMessage.set(
+ 'Dein Passwort wurde erfolgreich zurückgesetzt. Du kannst dich jetzt anmelden.'
+ );
setTimeout(() => {
this.router.navigate([''], { queryParams: { login: true } });
}, 3000);
@@ -115,7 +119,7 @@ export class RecoverPasswordComponent {
this.errorMessage.set(
err.error?.message || 'Ein Fehler ist aufgetreten. Bitte versuche es später erneut.'
);
- }
+ },
});
}
}
diff --git a/frontend/src/app/service/auth.service.ts b/frontend/src/app/service/auth.service.ts
index b51a4a1..f1cfbe9 100644
--- a/frontend/src/app/service/auth.service.ts
+++ b/frontend/src/app/service/auth.service.ts
@@ -77,11 +77,11 @@ export class AuthService {
public verifyEmail(token: string): Observable
{
return this.http.post(`${this.authUrl}/verify?token=${token}`, null);
}
-
+
public recoverPassword(email: string): Observable {
return this.http.post(`${this.authUrl}/recover-password?email=${email}`, null);
}
-
+
public resetPassword(token: string, password: string): Observable {
return this.http.post(`${this.authUrl}/reset-password`, { token, password });
}