Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Bugfix/fix landing page issue related to public page routes of AuthGuard (#5229)

Thomas Kaulf45d5fd2013a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8c680ffd75..32e4001a3d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -25,6 +25,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Upgraded `countries-and-timezones` from version `3.7.2` to `3.8.0`
- Upgraded `prisma` from version `6.11.1` to `6.12.0`
+### Fixed
+
+- Fixed an issue with the landing page related to the public page routes of the `AuthGuard`
+
## 2.183.0 - 2025-07-20
### Added
diff --git a/apps/client/src/app/core/auth.guard.ts b/apps/client/src/app/core/auth.guard.ts
index 69280af6a8..c264190315 100644
--- a/apps/client/src/app/core/auth.guard.ts
+++ b/apps/client/src/app/core/auth.guard.ts
@@ -14,20 +14,6 @@ import { catchError } from 'rxjs/operators';
@Injectable({ providedIn: 'root' })
export class AuthGuard {
- private static PUBLIC_PAGE_ROUTES = [
- `/${publicRoutes.about.path}`,
- `/${publicRoutes.blog.path}`,
- `/${publicRoutes.demo.path}`,
- `/${publicRoutes.faq.path}`,
- `/${publicRoutes.features.path}`,
- `/${publicRoutes.markets.path}`,
- `/${publicRoutes.openStartup.path}`,
- `/${publicRoutes.pricing.path}`,
- `/${publicRoutes.public.path}`,
- `/${publicRoutes.register.path}`,
- `/${publicRoutes.resources.path}`
- ];
-
public constructor(
private dataService: DataService,
private router: Router,
@@ -54,10 +40,14 @@ export class AuthGuard {
this.router.navigate(publicRoutes.register.routerLink);
resolve(false);
} else if (
- AuthGuard.PUBLIC_PAGE_ROUTES.some((publicPageRoute) => {
- const [, url] = decodeURIComponent(state.url).split('/');
- return `/${url}` === publicPageRoute;
- })
+ Object.values(publicRoutes)
+ .map(({ path }) => {
+ return `/${path}`;
+ })
+ .some((publicPageRoute) => {
+ const [, url] = decodeURIComponent(state.url).split('/');
+ return `/${url}` === publicPageRoute;
+ })
) {
resolve(true);
return EMPTY;