69 lines
2.2 KiB
HTML
69 lines
2.2 KiB
HTML
<div class="container">
|
|
<form class="form" [formGroup]="loginForm">
|
|
<h3>Anmeldung</h3>
|
|
<p class="field">
|
|
Um auf den Dienst zuzugreifen, musst Du Deine Anmeldedaten eingeben.
|
|
</p>
|
|
|
|
<mat-form-field class="field">
|
|
<mat-label>Login</mat-label>
|
|
<input id="dp-login" matInput formControlName="login" />
|
|
@if (loginForm.controls.login.hasError('required')) {
|
|
<mat-error>Fehler: <b>Login</b> erforderlich.</mat-error>
|
|
} @else if (loginForm.controls.login.hasError('minlength')) {
|
|
<mat-error>Fehler: <b>Login</b> ist unvollständig.</mat-error>
|
|
}
|
|
</mat-form-field>
|
|
|
|
<mat-form-field class="field">
|
|
<mat-label>Passwort</mat-label>
|
|
<input
|
|
id="dp-password"
|
|
matInput
|
|
[type]="showPassword ? 'text' : 'password'"
|
|
formControlName="password" />
|
|
@if (showPassword) {
|
|
<mat-icon matSuffix (click)="showPassword = false">visibility</mat-icon>
|
|
} @else {
|
|
<mat-icon matSuffix (click)="showPassword = true"
|
|
>visibility_off</mat-icon
|
|
>
|
|
}
|
|
@if (loginForm.controls.password.hasError('required')) {
|
|
<mat-error>Fehler: <b>Passwort</b> erforderlich.</mat-error>
|
|
} @else if (loginForm.controls.password.hasError('minlength')) {
|
|
<mat-error>Fehler: <b>Passwort</b> ist unvollständig.</mat-error>
|
|
}
|
|
</mat-form-field>
|
|
<button
|
|
mat-raised-button
|
|
class="button"
|
|
(click)="login()"
|
|
[disabled]="!loginForm.valid || (credentialService.validating | async)">
|
|
Anmelden
|
|
</button>
|
|
|
|
<div class="field" style="text-align: center; margin-top: -10px">
|
|
<button mat-button type="button" routerLink="/register">
|
|
Noch kein Konto? <b>Registrieren</b>
|
|
</button>
|
|
</div>
|
|
</form>
|
|
<p class="progress">
|
|
@if (credentialService.validating | async) {
|
|
<span><i>Anmeldung läuft,</i> bitte warte einen Moment.</span>
|
|
} @else {
|
|
@if (
|
|
(credentialService.authenticated | async) &&
|
|
!(credentialService.superadmin | async) &&
|
|
!(credentialService.universityadmin | async)
|
|
) {
|
|
<span class="error"
|
|
>Fehler: <b>{{ credentialService.login.value }}</b> ist nicht
|
|
berechtigt.</span
|
|
>
|
|
}
|
|
}
|
|
</p>
|
|
</div>
|