bundle size
This commit is contained in:
@@ -44,13 +44,13 @@
|
|||||||
"budgets": [
|
"budgets": [
|
||||||
{
|
{
|
||||||
"type": "initial",
|
"type": "initial",
|
||||||
"maximumWarning": "500kB",
|
"maximumWarning": "5000kB",
|
||||||
"maximumError": "1MB"
|
"maximumError": "10MB"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "anyComponentStyle",
|
"type": "anyComponentStyle",
|
||||||
"maximumWarning": "2kB",
|
"maximumWarning": "20kB",
|
||||||
"maximumError": "4kB"
|
"maximumError": "40kB"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"outputHashing": "all"
|
"outputHashing": "all"
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { inject, Injectable } from '@angular/core';
|
import { inject, Injectable } from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { BehaviorSubject, Observable, tap, of, catchError } from 'rxjs';
|
import { BehaviorSubject, Observable, tap, of, catchError } from 'rxjs';
|
||||||
import { IUser } from '../../model/interface/user.interface';
|
import { IUser } from '../../model/interface/user.interface';
|
||||||
import { environment } from '../../../environments/environment.development';
|
import { environment } from '../../../environments/environment.development';
|
||||||
|
import { HotToastService } from '@ngxpert/hot-toast';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -13,7 +14,8 @@ export class AuthService {
|
|||||||
private accessTokenSubject = new BehaviorSubject<string | null>(null);
|
private accessTokenSubject = new BehaviorSubject<string | null>(null);
|
||||||
private refreshToken: string | null = null;
|
private refreshToken: string | null = null;
|
||||||
private http: HttpClient = inject(HttpClient);
|
private http: HttpClient = inject(HttpClient);
|
||||||
private route: ActivatedRoute = inject(ActivatedRoute);
|
private router: Router = inject(Router);
|
||||||
|
private toast: HotToastService = inject(HotToastService);
|
||||||
|
|
||||||
private user: IUser | null = null;
|
private user: IUser | null = null;
|
||||||
|
|
||||||
@@ -99,6 +101,8 @@ export class AuthService {
|
|||||||
this.refreshToken = null;
|
this.refreshToken = null;
|
||||||
localStorage.removeItem('accessToken_vault');
|
localStorage.removeItem('accessToken_vault');
|
||||||
localStorage.removeItem('refreshToken_vault');
|
localStorage.removeItem('refreshToken_vault');
|
||||||
|
this.router.navigateByUrl('/login');
|
||||||
|
this.toast.show('Du wurdest ausgeloggt.')
|
||||||
}
|
}
|
||||||
|
|
||||||
public routeToLogin() {
|
public routeToLogin() {
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
<button mat-icon-button class="example-icon favorite-icon" aria-label="Example icon-button with heart icon">
|
<button mat-icon-button class="example-icon favorite-icon" aria-label="Example icon-button with heart icon">
|
||||||
<mat-icon>favorite</mat-icon>
|
<mat-icon>favorite</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button mat-icon-button class="example-icon" aria-label="Example icon-button with share icon">
|
<button mat-icon-button (click)="logout()">
|
||||||
<mat-icon>share</mat-icon>
|
<mat-icon>logout</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</mat-toolbar>
|
</mat-toolbar>
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component, inject } from '@angular/core';
|
||||||
import { MatButtonModule } from '@angular/material/button';
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
import { MatIconModule } from '@angular/material/icon';
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
import { MatSidenavModule } from '@angular/material/sidenav';
|
import { MatSidenavModule } from '@angular/material/sidenav';
|
||||||
import { MatToolbarModule } from '@angular/material/toolbar';
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
|
import { AuthService } from '../auth/auth.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-layout',
|
selector: 'app-layout',
|
||||||
@@ -13,5 +14,9 @@ import { RouterModule } from '@angular/router';
|
|||||||
styleUrl: './layout.component.scss'
|
styleUrl: './layout.component.scss'
|
||||||
})
|
})
|
||||||
export class LayoutComponent {
|
export class LayoutComponent {
|
||||||
|
private authService: AuthService = inject(AuthService);
|
||||||
|
|
||||||
|
logout(){
|
||||||
|
this.authService.logout();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1,8 @@
|
|||||||
<button mat-flat-button color="primary" (click)="authService.routeToLogin()">Login</button>
|
<div class="container">
|
||||||
|
<p>
|
||||||
|
Du bist nicht eingeloggt. Logge dich ein um zu Beginnen.
|
||||||
|
</p>
|
||||||
|
<div>
|
||||||
|
<button mat-raised-button color="primary" (click)="authService.routeToLogin()">Einloggen!</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
:host {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100vh;
|
||||||
|
width: 100vw;
|
||||||
|
background-image: url("../../../../assets/img/key_2.webp");
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
padding: 36px;
|
||||||
|
// border: 1px solid #ccc;
|
||||||
|
border-radius: 24px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
color: white;
|
||||||
|
gap: 24px;
|
||||||
|
background: rgba(50, 50, 50, 0.4); /* halbtransparentes Weiß */
|
||||||
|
backdrop-filter: blur(5px); /* Unschärfe */
|
||||||
|
}
|
||||||
BIN
client/src/assets/img/key.jpg
Normal file
BIN
client/src/assets/img/key.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 142 KiB |
BIN
client/src/assets/img/key_2.webp
Normal file
BIN
client/src/assets/img/key_2.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 177 KiB |
Reference in New Issue
Block a user