Fix errors and warnings on login/logout

pull/8/head
Max Ehrlicher-Schmidt 4 years ago
parent a813028f88
commit 735f1e465b

@ -63,8 +63,8 @@ export class AppComponent {
}
logout() {
this.navService.closeNav();
this.authService.logout().subscribe().add(() => this.router.navigate(['login']));
this.sideNav.close();
}
ngAfterViewInit() {

@ -1,4 +1,4 @@
<div routerLink = "/profile" >
<div routerLink = "/profile" class="sidenav-profile">
<img class="navbar-photo" src={{profileURL}}>
<p>{{name}}</p>
<p>{{email}}</p>

@ -5,4 +5,8 @@
height:100px;
border-radius:50%;
margin-top:10px;
}
.sidenav-profile {
outline: none;
}

@ -1,41 +1,46 @@
<div id="login-form">
<div id="login-wrapper">
<h1>fLotte Login</h1>
<mat-form-field (keyup.enter)="login()">
<mat-label>E-Mail-Adresse eingeben</mat-label>
<input matInput placeholder="fLotte@beispiel.de" [formControl]="email" />
<mat-error *ngIf="email.hasError('required')">
Bitte geben Sie eine E-Mail-Adresse ein.
</mat-error>
<mat-error *ngIf="email.hasError('email')">
Bitte geben Sie eine valide E-Mail-Adresse ein.
</mat-error>
</mat-form-field>
<form id="login-form">
<mat-form-field (keyup.enter)="login()">
<mat-label>E-Mail-Adresse eingeben</mat-label>
<input matInput placeholder="fLotte@beispiel.de" autocomplete="email" [formControl]="email" />
<mat-error *ngIf="email.hasError('required')">
Bitte geben Sie eine E-Mail-Adresse ein.
</mat-error>
<mat-error *ngIf="email.hasError('email')">
Bitte geben Sie eine valide E-Mail-Adresse ein.
</mat-error>
</mat-form-field>
<mat-form-field (keyup.enter)="login()">
<mat-label>Passwort eingeben</mat-label>
<input
matInput
[type]="hide ? 'password' : 'text'"
[formControl]="password"
/>
<mat-error *ngIf="password.hasError('required')">
Bitte geben Sie Ihr Passwort ein.
</mat-error>
<button
mat-icon-button
matSuffix
(click)="hide = !hide"
[attr.aria-label]="'Hide password'"
[attr.aria-pressed]="hide"
>
<mat-icon>{{ hide ? "visibility_off" : "visibility" }}</mat-icon>
</button>
</mat-form-field>
<mat-progress-bar mode="indeterminate" id="loading-bar" *ngIf="loading"></mat-progress-bar>
<button mat-stroked-button color="primary" (click)="login()">
Login
</button>
<mat-form-field (keyup.enter)="login()">
<mat-label>Passwort eingeben</mat-label>
<input
matInput
autocomplete="password"
[type]="hide ? 'password' : 'text'"
[formControl]="password"
/>
<mat-error *ngIf="password.hasError('required')">
Bitte geben Sie Ihr Passwort ein.
</mat-error>
<button
mat-icon-button
matSuffix
(click)="hide = !hide"
[attr.aria-label]="'Hide password'"
[attr.aria-pressed]="hide"
>
<mat-icon>{{ hide ? "visibility_off" : "visibility" }}</mat-icon>
</button>
</mat-form-field>
</form>
<mat-progress-bar
mode="indeterminate"
id="loading-bar"
*ngIf="loading"
></mat-progress-bar>
<button mat-stroked-button color="primary" (click)="login()">Login</button>
<mat-error class="login-error-message" *ngIf="errorOccurred">
{{errorMessage}}
{{ errorMessage }}
</mat-error>
</div>

@ -1,4 +1,7 @@
#login-form {
#login-wrapper {
#login-form {
display: contents;
}
display: flex;
flex-direction: column;
max-width: 32em;

Loading…
Cancel
Save