165 lines
5.1 KiB
HTML
165 lines
5.1 KiB
HTML
<section class="login-page">
|
|
<div class="login-panel">
|
|
<div class="brand-block">
|
|
<span class="eyebrow">SmartGuide Account Portal</span>
|
|
<h1>Passwort zurücksetzen</h1>
|
|
<p>Gib ein neues Passwort für Dein Konto ein.</p>
|
|
</div>
|
|
|
|
@if (passwordChanged()) {
|
|
<div class="login-form">
|
|
<div class="code-intro">
|
|
<mat-icon>check_circle</mat-icon>
|
|
<div>
|
|
<strong>Passwort geändert</strong>
|
|
<span>
|
|
Dein Passwort wurde erfolgreich geändert. Bitte melde Dich mit dem
|
|
neuen Passwort an.
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
<button
|
|
mat-flat-button
|
|
color="primary"
|
|
class="submit-button"
|
|
type="button"
|
|
routerLink="/login">
|
|
Zurück zum Login
|
|
</button>
|
|
</div>
|
|
} @else if (!hasToken()) {
|
|
<div class="login-form">
|
|
<div class="code-intro">
|
|
<mat-icon>error_outline</mat-icon>
|
|
<div>
|
|
<strong>Ungültiger Link</strong>
|
|
<span>
|
|
Der Link zum Zurücksetzen des Passworts ist ungültig oder
|
|
unvollständig.
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
<
|
|
<div class="form-actions">
|
|
<a class="auth-link" routerLink="/login">Zurück zum Login</a>
|
|
|
|
<a class="auth-link" routerLink="/forgot-password"
|
|
>Neuen Link anfordern</a
|
|
>
|
|
</div>
|
|
</div>
|
|
} @else if (linkInvalid()) {
|
|
<div class="login-form">
|
|
<div class="code-intro">
|
|
<mat-icon>error_outline</mat-icon>
|
|
<div>
|
|
<strong>Link nicht mehr gültig</strong>
|
|
<span>
|
|
Der Link zum Zurücksetzen des Passworts ist abgelaufen oder wurde
|
|
bereits verwendet.
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-actions">
|
|
<a class="auth-link" routerLink="/forgot-password"
|
|
>Neuen Link anfordern</a
|
|
>
|
|
<a class="auth-link" routerLink="/login">Zurück zum Login</a>
|
|
</div>
|
|
</div>
|
|
} @else {
|
|
<form class="login-form" [formGroup]="form" (ngSubmit)="resetPassword()">
|
|
<mat-form-field class="field" appearance="outline">
|
|
<mat-label>Neues Passwort</mat-label>
|
|
<input
|
|
matInput
|
|
[type]="showPasswords() ? 'text' : 'password'"
|
|
autocomplete="new-password"
|
|
formControlName="newPassword" />
|
|
|
|
<button
|
|
mat-icon-button
|
|
matSuffix
|
|
type="button"
|
|
[attr.aria-label]="
|
|
showPasswords() ? 'Passwort verbergen' : 'Passwort anzeigen'
|
|
"
|
|
(click)="showPasswords.set(!showPasswords())">
|
|
<mat-icon>
|
|
{{ showPasswords() ? 'visibility' : 'visibility_off' }}
|
|
</mat-icon>
|
|
</button>
|
|
|
|
@if (form.controls.newPassword.hasError('required')) {
|
|
<mat-error>Neues Passwort ist erforderlich.</mat-error>
|
|
} @else if (form.controls.newPassword.hasError('minlength')) {
|
|
<mat-error>Passwort muss mindestens 8 Zeichen haben.</mat-error>
|
|
} @else if (form.controls.newPassword.hasError('maxlength')) {
|
|
<mat-error>Passwort darf maximal 64 Zeichen haben.</mat-error>
|
|
}
|
|
</mat-form-field>
|
|
|
|
<mat-form-field class="field" appearance="outline">
|
|
<mat-label>Neues Passwort wiederholen</mat-label>
|
|
<input
|
|
matInput
|
|
[type]="showPasswords() ? 'text' : 'password'"
|
|
autocomplete="new-password"
|
|
formControlName="confirmPassword" />
|
|
|
|
<button
|
|
mat-icon-button
|
|
matSuffix
|
|
type="button"
|
|
[attr.aria-label]="
|
|
showPasswords() ? 'Passwort verbergen' : 'Passwort anzeigen'
|
|
"
|
|
(click)="showPasswords.set(!showPasswords())">
|
|
<mat-icon>
|
|
{{ showPasswords() ? 'visibility' : 'visibility_off' }}
|
|
</mat-icon>
|
|
</button>
|
|
|
|
@if (form.controls.confirmPassword.hasError('required')) {
|
|
<mat-error>Bitte wiederhole das neue Passwort.</mat-error>
|
|
} @else if (
|
|
form.controls.confirmPassword.hasError('passwordsMismatch')
|
|
) {
|
|
<mat-error>Die Passwörter stimmen nicht überein.</mat-error>
|
|
}
|
|
</mat-form-field>
|
|
|
|
@if (errorMessage()) {
|
|
<div class="code-intro">
|
|
<mat-icon>error_outline</mat-icon>
|
|
<div>
|
|
<strong>Fehler</strong>
|
|
<span>{{ errorMessage() }}</span>
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
<button
|
|
mat-flat-button
|
|
color="primary"
|
|
class="submit-button"
|
|
type="submit"
|
|
[disabled]="form.invalid || isSubmitting()">
|
|
@if (isSubmitting()) {
|
|
Passwort wird geändert...
|
|
} @else {
|
|
Passwort ändern
|
|
}
|
|
</button>
|
|
|
|
<div class="form-actions form-actions-single">
|
|
<a class="auth-link" routerLink="/login">Zurück zum Login</a>
|
|
</div>
|
|
</form>
|
|
}
|
|
</div>
|
|
</section>
|