change password
All checks were successful
Release / publish (push) Successful in 4m9s

This commit is contained in:
u80864958
2025-05-13 14:06:11 +02:00
parent 73ff28347a
commit 30dac9f12f
21 changed files with 288 additions and 16 deletions

View File

@ -0,0 +1,39 @@
import { Component, EventEmitter, inject, Output, output } from '@angular/core';
import {
FormControl,
FormGroup,
ReactiveFormsModule,
Validators,
} from '@angular/forms';
import { AuthService } from '../../shared/services/auth.service';
@Component({
selector: 'app-change-password',
imports: [ReactiveFormsModule],
templateUrl: './change-password.component.html',
})
export class ChangePasswordComponent {
@Output() done = new EventEmitter();
private auth = inject(AuthService);
form = new FormGroup({
password: new FormControl('', [
Validators.required,
Validators.minLength(6),
]),
});
submit() {
if (this.form.invalid) {
this.form.markAllAsTouched();
return;
}
this.auth
.changePassword(this.form.controls.password.value!)
.then((success) => {
if (success) {
this.done.emit();
}
});
}
}