diff --git a/frontend/src/app/guards/auth.guard.ts b/frontend/src/app/guards/auth.guard.ts index f3f7196..fcc3e7b 100644 --- a/frontend/src/app/guards/auth.guard.ts +++ b/frontend/src/app/guards/auth.guard.ts @@ -2,7 +2,6 @@ import {Injectable} from '@angular/core'; import {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree} from '@angular/router'; import {Observable} from 'rxjs'; import {AuthService} from '@services/auth.service'; -import {environment} from '@environment'; @Injectable({ providedIn: 'root' @@ -19,9 +18,6 @@ export class AuthGuard implements CanActivate { route: ActivatedRouteSnapshot, state: RouterStateSnapshot ): Observable | Promise | boolean | UrlTree { - if (environment.defaultAuthStatus) { - return true; - } if (!this.authService.checkAuthStatus()) { return this.router.createUrlTree(['/']); } diff --git a/frontend/src/app/services/auth.service.ts b/frontend/src/app/services/auth.service.ts index 13a10ab..c4b4c2a 100644 --- a/frontend/src/app/services/auth.service.ts +++ b/frontend/src/app/services/auth.service.ts @@ -5,19 +5,18 @@ 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 {environment} from '@environment'; @Injectable({ providedIn: 'root' }) export class AuthService { - private isAuthenticatedSubject = new BehaviorSubject(environment.defaultAuthStatus); + private isAuthenticatedSubject = new BehaviorSubject(false); public isAuthenticated$ = this.isAuthenticatedSubject.asObservable(); private userClaimsSubject = new BehaviorSubject(null); public userClaims$ = this.userClaimsSubject.asObservable(); private jwtHelper = new JwtHelperService(); - private _username = signal(environment.defaultAuthStatus ? 'akastijn' : null); + private _username = signal(null); public readonly username = this._username.asReadonly(); constructor( @@ -136,9 +135,6 @@ export class AuthService { } public getUuid(): string | null { - if (environment.defaultAuthStatus) { - return '55e46bc3-2a29-4c53-850f-dbd944dc5c5f'; - } const jwtClaims = this.userClaimsSubject.getValue(); if (jwtClaims === null) { return null; diff --git a/frontend/src/environments/environment.beta.ts b/frontend/src/environments/environment.beta.ts index 312e52a..68af751 100644 --- a/frontend/src/environments/environment.beta.ts +++ b/frontend/src/environments/environment.beta.ts @@ -1,5 +1,4 @@ export const environment = { production: true, apiUrl: 'https://beta.alttd.com', - defaultAuthStatus: false }; diff --git a/frontend/src/environments/environment.development.ts b/frontend/src/environments/environment.development.ts index 2777fe3..126cf4c 100644 --- a/frontend/src/environments/environment.development.ts +++ b/frontend/src/environments/environment.development.ts @@ -1,5 +1,4 @@ export const environment = { production: false, apiUrl: 'http://localhost:8080', - defaultAuthStatus: true }; diff --git a/frontend/src/environments/environment.production.ts b/frontend/src/environments/environment.production.ts index 8ab7852..ff15d7e 100644 --- a/frontend/src/environments/environment.production.ts +++ b/frontend/src/environments/environment.production.ts @@ -1,5 +1,4 @@ export const environment = { production: true, apiUrl: 'https://alttd.com', - defaultAuthStatus: false }; diff --git a/frontend/src/environments/environment.ts b/frontend/src/environments/environment.ts index 8ab7852..ff15d7e 100644 --- a/frontend/src/environments/environment.ts +++ b/frontend/src/environments/environment.ts @@ -1,5 +1,4 @@ export const environment = { production: true, apiUrl: 'https://alttd.com', - defaultAuthStatus: false };