diff --git a/client/angular.json b/client/angular.json index 4617cdd..02c5ba5 100644 --- a/client/angular.json +++ b/client/angular.json @@ -44,13 +44,13 @@ "budgets": [ { "type": "initial", - "maximumWarning": "500kB", - "maximumError": "1MB" + "maximumWarning": "5000kB", + "maximumError": "10MB" }, { "type": "anyComponentStyle", - "maximumWarning": "2kB", - "maximumError": "4kB" + "maximumWarning": "20kB", + "maximumError": "40kB" } ], "outputHashing": "all" diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts index 227ad15..8351257 100644 --- a/client/src/app/core/auth/auth.service.ts +++ b/client/src/app/core/auth/auth.service.ts @@ -1,9 +1,10 @@ import { HttpClient } from '@angular/common/http'; 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 { IUser } from '../../model/interface/user.interface'; import { environment } from '../../../environments/environment.development'; +import { HotToastService } from '@ngxpert/hot-toast'; @Injectable({ providedIn: 'root' @@ -13,7 +14,8 @@ export class AuthService { private accessTokenSubject = new BehaviorSubject(null); private refreshToken: string | null = null; 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; @@ -99,6 +101,8 @@ export class AuthService { this.refreshToken = null; localStorage.removeItem('accessToken_vault'); localStorage.removeItem('refreshToken_vault'); + this.router.navigateByUrl('/login'); + this.toast.show('Du wurdest ausgeloggt.') } public routeToLogin() { diff --git a/client/src/app/core/layout/layout.component.html b/client/src/app/core/layout/layout.component.html index f34319c..eb9d634 100644 --- a/client/src/app/core/layout/layout.component.html +++ b/client/src/app/core/layout/layout.component.html @@ -7,8 +7,8 @@ - diff --git a/client/src/app/core/layout/layout.component.ts b/client/src/app/core/layout/layout.component.ts index 33274e2..67e21c3 100644 --- a/client/src/app/core/layout/layout.component.ts +++ b/client/src/app/core/layout/layout.component.ts @@ -1,9 +1,10 @@ -import { Component } from '@angular/core'; +import { Component, inject } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatToolbarModule } from '@angular/material/toolbar'; import { RouterModule } from '@angular/router'; +import { AuthService } from '../auth/auth.service'; @Component({ selector: 'app-layout', @@ -13,5 +14,9 @@ import { RouterModule } from '@angular/router'; styleUrl: './layout.component.scss' }) export class LayoutComponent { + private authService: AuthService = inject(AuthService); + logout(){ + this.authService.logout(); + } } diff --git a/client/src/app/modules/auth/login/login.component.html b/client/src/app/modules/auth/login/login.component.html index 6e2f42f..8ad5d48 100644 --- a/client/src/app/modules/auth/login/login.component.html +++ b/client/src/app/modules/auth/login/login.component.html @@ -1 +1,8 @@ - \ No newline at end of file +
+

+ Du bist nicht eingeloggt. Logge dich ein um zu Beginnen. +

+
+ +
+
\ No newline at end of file diff --git a/client/src/app/modules/auth/login/login.component.scss b/client/src/app/modules/auth/login/login.component.scss index e69de29..111c9bc 100644 --- a/client/src/app/modules/auth/login/login.component.scss +++ b/client/src/app/modules/auth/login/login.component.scss @@ -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 */ +} \ No newline at end of file diff --git a/client/src/assets/img/key.jpg b/client/src/assets/img/key.jpg new file mode 100644 index 0000000..d318751 Binary files /dev/null and b/client/src/assets/img/key.jpg differ diff --git a/client/src/assets/img/key_2.webp b/client/src/assets/img/key_2.webp new file mode 100644 index 0000000..d7d2cbc Binary files /dev/null and b/client/src/assets/img/key_2.webp differ