diff --git a/frontend/src/app/feature/landing/landing.component.ts b/frontend/src/app/feature/landing/landing.component.ts
index 9e66baf..a3b77e3 100644
--- a/frontend/src/app/feature/landing/landing.component.ts
+++ b/frontend/src/app/feature/landing/landing.component.ts
@@ -1,12 +1,13 @@
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';
@Component({
selector: 'app-landing-page',
standalone: true,
- imports: [NgFor, RouterLink],
+ imports: [NavbarComponent, 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
new file mode 100644
index 0000000..e69de29
diff --git a/frontend/src/app/feature/login-success/login-success.component.html b/frontend/src/app/feature/login-success/login-success.component.html
new file mode 100644
index 0000000..ba9d449
--- /dev/null
+++ b/frontend/src/app/feature/login-success/login-success.component.html
@@ -0,0 +1 @@
+
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
new file mode 100644
index 0000000..d10a322
--- /dev/null
+++ b/frontend/src/app/feature/login-success/login-success.component.ts
@@ -0,0 +1,43 @@
+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 d4abab7..cc234ac 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,3 +1,5 @@
+
+
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 20faa02..97e5200 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
@@ -3,6 +3,7 @@ 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';
@@ -10,7 +11,7 @@ import { AuthService } from '@service/auth.service';
@Component({
selector: 'app-lootbox-opening',
standalone: true,
- imports: [CommonModule],
+ imports: [CommonModule, NavbarComponent],
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 76fcc04..25d8df0 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,3 +1,4 @@
+
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 373199b..dc39869 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,5 +1,6 @@
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';
@@ -11,7 +12,7 @@ import { UserService } from '@service/user.service';
@Component({
selector: 'app-lootbox-selection',
standalone: true,
- imports: [CommonModule],
+ imports: [CommonModule, NavbarComponent],
templateUrl: './lootbox-selection.component.html',
styleUrls: ['./lootbox-selection.component.css'],
})
diff --git a/frontend/src/app/shared/components/navbar/navbar.component.html b/frontend/src/app/shared/components/navbar/navbar.component.html
index 749437f..90b63eb 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 8f646f5..5d44f60 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 = signal(this.authService.isLoggedIn());
+ isLoggedIn = this.authService.isLoggedIn();
private authSubscription!: Subscription;
public balance = signal(0);
@@ -30,7 +30,6 @@ 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());
},
});
}