style: format HTML and TypeScript files for consistency
All checks were successful
CI / Get Changed Files (pull_request) Successful in 10s
CI / oxlint (pull_request) Successful in 26s
CI / Docker frontend validation (pull_request) Successful in 29s
CI / eslint (pull_request) Successful in 38s
CI / prettier (pull_request) Successful in 41s
CI / test-build (pull_request) Successful in 1m6s
CI / Checkstyle Main (pull_request) Successful in 1m29s
CI / Docker backend validation (pull_request) Successful in 1m27s

This commit is contained in:
csimonis 2025-05-15 12:34:28 +02:00 committed by Phan Huy Tran
commit d049048206
4 changed files with 51 additions and 37 deletions

View file

@ -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.'
);
}
},
});
}
}