diff --git a/frontend/src/app/feature/landing/landing.component.ts b/frontend/src/app/feature/landing/landing.component.ts
index a3b77e3..b12c5d7 100644
--- a/frontend/src/app/feature/landing/landing.component.ts
+++ b/frontend/src/app/feature/landing/landing.component.ts
@@ -1,13 +1,12 @@
-import { ChangeDetectionStrategy, Component, inject, OnDestroy, OnInit } from '@angular/core';
-import { NgFor } from '@angular/common';
-import { NavbarComponent } from '@shared/components/navbar/navbar.component';
-import { RouterLink } from '@angular/router';
-import { AuthService } from '@service/auth.service';
+import {ChangeDetectionStrategy, Component, inject, OnDestroy, OnInit} from '@angular/core';
+import {NgFor} from '@angular/common';
+import {RouterLink} from '@angular/router';
+import {AuthService} from '@service/auth.service';
@Component({
selector: 'app-landing-page',
standalone: true,
- imports: [NavbarComponent, NgFor, RouterLink],
+ imports: [NgFor, RouterLink],
templateUrl: './landing.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
diff --git a/frontend/src/app/feature/login-success/login-success.component.css b/frontend/src/app/feature/login-success/login-success.component.css
deleted file mode 100644
index e69de29..0000000
diff --git a/frontend/src/app/feature/login-success/login-success.component.html b/frontend/src/app/feature/login-success/login-success.component.html
deleted file mode 100644
index ba9d449..0000000
--- a/frontend/src/app/feature/login-success/login-success.component.html
+++ /dev/null
@@ -1 +0,0 @@
-
Logging in...
diff --git a/frontend/src/app/feature/login-success/login-success.component.ts b/frontend/src/app/feature/login-success/login-success.component.ts
deleted file mode 100644
index d10a322..0000000
--- a/frontend/src/app/feature/login-success/login-success.component.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import { ChangeDetectionStrategy, Component, inject, OnInit } from '@angular/core';
-import { Router } from '@angular/router';
-import { AuthService } from '../../service/auth.service';
-import { OAuthService } from 'angular-oauth2-oidc';
-
-@Component({
- selector: 'app-login-success',
- standalone: true,
- imports: [],
- templateUrl: './login-success.component.html',
- styleUrl: './login-success.component.css',
- changeDetection: ChangeDetectionStrategy.OnPush,
-})
-export default class LoginSuccessComponent implements OnInit {
- private authService: AuthService = inject(AuthService);
- private oauthService: OAuthService = inject(OAuthService);
- private router: Router = inject(Router);
-
- async ngOnInit() {
- try {
- if (this.oauthService.hasValidAccessToken()) {
- this.router.navigate(['/home']);
- } else {
- setTimeout(() => {
- if (this.oauthService.hasValidAccessToken() || this.authService.getUser()) {
- this.router.navigate(['/home']);
- } else {
- this.router.navigate(['/']);
- }
- }, 3000);
- }
- } catch (err) {
- console.error('Error during login callback:', err);
- setTimeout(() => {
- if (this.authService.isLoggedIn()) {
- this.router.navigate(['/home']);
- } else {
- this.router.navigate(['/']);
- }
- }, 3000);
- }
- }
-}
diff --git a/frontend/src/app/feature/lootboxes/lootbox-opening/lootbox-opening.component.html b/frontend/src/app/feature/lootboxes/lootbox-opening/lootbox-opening.component.html
index cc234ac..d4abab7 100644
--- a/frontend/src/app/feature/lootboxes/lootbox-opening/lootbox-opening.component.html
+++ b/frontend/src/app/feature/lootboxes/lootbox-opening/lootbox-opening.component.html
@@ -1,5 +1,3 @@
-
-
Lootbox Öffnen
diff --git a/frontend/src/app/feature/lootboxes/lootbox-opening/lootbox-opening.component.ts b/frontend/src/app/feature/lootboxes/lootbox-opening/lootbox-opening.component.ts
index 97e5200..2624299 100644
--- a/frontend/src/app/feature/lootboxes/lootbox-opening/lootbox-opening.component.ts
+++ b/frontend/src/app/feature/lootboxes/lootbox-opening/lootbox-opening.component.ts
@@ -1,17 +1,16 @@
-import { ChangeDetectorRef, Component } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { ActivatedRoute, Router } from '@angular/router';
-import { LootboxService } from '../services/lootbox.service';
-import { LootBox, Reward } from 'app/model/LootBox';
-import { NavbarComponent } from '@shared/components/navbar/navbar.component';
-import { UserService } from '@service/user.service';
-import { User } from 'app/model/User';
-import { AuthService } from '@service/auth.service';
+import {ChangeDetectorRef, Component} from '@angular/core';
+import {CommonModule} from '@angular/common';
+import {ActivatedRoute, Router} from '@angular/router';
+import {LootboxService} from '../services/lootbox.service';
+import {LootBox, Reward} from 'app/model/LootBox';
+import {UserService} from '@service/user.service';
+import {User} from 'app/model/User';
+import {AuthService} from '@service/auth.service';
@Component({
selector: 'app-lootbox-opening',
standalone: true,
- imports: [CommonModule, NavbarComponent],
+ imports: [CommonModule],
templateUrl: './lootbox-opening.component.html',
styleUrls: ['./lootbox-opening.component.css'],
})
diff --git a/frontend/src/app/feature/lootboxes/lootbox-selection/lootbox-selection.component.html b/frontend/src/app/feature/lootboxes/lootbox-selection/lootbox-selection.component.html
index 25d8df0..76fcc04 100644
--- a/frontend/src/app/feature/lootboxes/lootbox-selection/lootbox-selection.component.html
+++ b/frontend/src/app/feature/lootboxes/lootbox-selection/lootbox-selection.component.html
@@ -1,4 +1,3 @@
-
Lootboxen
diff --git a/frontend/src/app/feature/lootboxes/lootbox-selection/lootbox-selection.component.ts b/frontend/src/app/feature/lootboxes/lootbox-selection/lootbox-selection.component.ts
index dc39869..cc3e91f 100644
--- a/frontend/src/app/feature/lootboxes/lootbox-selection/lootbox-selection.component.ts
+++ b/frontend/src/app/feature/lootboxes/lootbox-selection/lootbox-selection.component.ts
@@ -1,18 +1,17 @@
-import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { NavbarComponent } from '@shared/components/navbar/navbar.component';
-import { LootboxService } from '../services/lootbox.service';
-import { LootBox } from 'app/model/LootBox';
-import { Router } from '@angular/router';
-import { timeout } from 'rxjs';
-import { User } from 'app/model/User';
-import { AuthService } from '@service/auth.service';
-import { UserService } from '@service/user.service';
+import {ChangeDetectorRef, Component, OnInit} from '@angular/core';
+import {CommonModule} from '@angular/common';
+import {LootboxService} from '../services/lootbox.service';
+import {LootBox} from 'app/model/LootBox';
+import {Router} from '@angular/router';
+import {timeout} from 'rxjs';
+import {User} from 'app/model/User';
+import {AuthService} from '@service/auth.service';
+import {UserService} from '@service/user.service';
@Component({
selector: 'app-lootbox-selection',
standalone: true,
- imports: [CommonModule, NavbarComponent],
+ imports: [CommonModule],
templateUrl: './lootbox-selection.component.html',
styleUrls: ['./lootbox-selection.component.css'],
})
diff --git a/frontend/src/app/feature/transaction-history/transaction-history.component.ts b/frontend/src/app/feature/transaction-history/transaction-history.component.ts
index 338ef4e..b0e12f8 100644
--- a/frontend/src/app/feature/transaction-history/transaction-history.component.ts
+++ b/frontend/src/app/feature/transaction-history/transaction-history.component.ts
@@ -1,15 +1,8 @@
-import {
- ChangeDetectionStrategy,
- Component,
- EventEmitter,
- inject,
- Input,
- Output,
-} from '@angular/core';
-import { TransactionService } from '@service/transaction.service';
-import { Observable } from 'rxjs';
-import { AsyncPipe, CurrencyPipe, DatePipe, NgIf } from '@angular/common';
-import { TransactionData } from '../../model/TransactionData';
+import {ChangeDetectionStrategy, Component, EventEmitter, inject, Input, Output,} from '@angular/core';
+import {TransactionService} from '@service/transaction.service';
+import {Observable} from 'rxjs';
+import {AsyncPipe, CurrencyPipe, DatePipe, NgIf} from '@angular/common';
+import {TransactionData} from '../../model/TransactionData';
const PER_PAGE = 5;
diff --git a/frontend/src/app/shared/components/navbar/navbar.component.html b/frontend/src/app/shared/components/navbar/navbar.component.html
index 90b63eb..749437f 100644
--- a/frontend/src/app/shared/components/navbar/navbar.component.html
+++ b/frontend/src/app/shared/components/navbar/navbar.component.html
@@ -11,7 +11,7 @@
- @if (!isLoggedIn) {
+ @if (!isLoggedIn()) {
Anmelden
Registrieren
}
- @if (isLoggedIn) {
+ @if (isLoggedIn()) {
Spiele
- @if (!isLoggedIn) {
+ @if (!isLoggedIn()) {
Anmelden
@@ -80,7 +80,7 @@
>Registrieren
}
- @if (isLoggedIn) {
+ @if (isLoggedIn()) {
}
diff --git a/frontend/src/app/shared/components/navbar/navbar.component.ts b/frontend/src/app/shared/components/navbar/navbar.component.ts
index 5d44f60..8f646f5 100644
--- a/frontend/src/app/shared/components/navbar/navbar.component.ts
+++ b/frontend/src/app/shared/components/navbar/navbar.component.ts
@@ -21,7 +21,7 @@ import { AnimatedNumberComponent } from '@blackjack/components/animated-number/a
export class NavbarComponent implements OnInit, OnDestroy {
isMenuOpen = false;
private authService: AuthService = inject(AuthService);
- isLoggedIn = this.authService.isLoggedIn();
+ isLoggedIn = signal(this.authService.isLoggedIn());
private authSubscription!: Subscription;
public balance = signal(0);
@@ -30,6 +30,7 @@ export class NavbarComponent implements OnInit, OnDestroy {
this.authSubscription = this.authService.userSubject.subscribe({
next: (user) => {
this.balance.set(user?.balance ?? 0);
+ this.isLoggedIn.set(this.authService.isLoggedIn());
},
});
}