diff --git a/frontend/src/app/services/auth.service.ts b/frontend/src/app/services/auth.service.ts index 1524b1c..3c6e0d5 100644 --- a/frontend/src/app/services/auth.service.ts +++ b/frontend/src/app/services/auth.service.ts @@ -1,15 +1,19 @@ -import {Injectable, signal} from '@angular/core'; +import {inject, Injectable, signal} from '@angular/core'; import {LoginService} from '@api'; import {Observable, throwError} from 'rxjs'; import {catchError, tap} from 'rxjs/operators'; import {MatSnackBar} from '@angular/material/snack-bar'; import {JwtHelperService} from '@auth0/angular-jwt'; import {JwtClaims} from '@custom-types/jwt_interface' +import {LoginDialogComponent} from '@shared-components/login/login.component'; +import {MatDialog} from '@angular/material/dialog'; @Injectable({ providedIn: 'root' }) export class AuthService { + private dialog: MatDialog = inject(MatDialog) + private isAuthenticatedSubject = signal(false); public readonly isAuthenticated$ = this.isAuthenticatedSubject.asReadonly(); @@ -72,6 +76,12 @@ export class AuthService { const jwt = this.getJwt(); if (!jwt) { console.log("No JWT found"); + const dialogRef = this.dialog.open(LoginDialogComponent, { + width: '400px', + }) + dialogRef.afterClosed().subscribe(result => { + console.log(result); + }); return false; } try {