Browse Source

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

* Fix landing page

* Update changelog
pull/5231/head
Thomas Kaul 3 weeks ago
committed by GitHub
parent
commit
f45d5fd201
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      CHANGELOG.md
  2. 26
      apps/client/src/app/core/auth.guard.ts

4
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 `countries-and-timezones` from version `3.7.2` to `3.8.0`
- Upgraded `prisma` from version `6.11.1` to `6.12.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 ## 2.183.0 - 2025-07-20
### Added ### Added

26
apps/client/src/app/core/auth.guard.ts

@ -14,20 +14,6 @@ import { catchError } from 'rxjs/operators';
@Injectable({ providedIn: 'root' }) @Injectable({ providedIn: 'root' })
export class AuthGuard { 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( public constructor(
private dataService: DataService, private dataService: DataService,
private router: Router, private router: Router,
@ -54,10 +40,14 @@ export class AuthGuard {
this.router.navigate(publicRoutes.register.routerLink); this.router.navigate(publicRoutes.register.routerLink);
resolve(false); resolve(false);
} else if ( } else if (
AuthGuard.PUBLIC_PAGE_ROUTES.some((publicPageRoute) => { Object.values(publicRoutes)
const [, url] = decodeURIComponent(state.url).split('/'); .map(({ path }) => {
return `/${url}` === publicPageRoute; return `/${path}`;
}) })
.some((publicPageRoute) => {
const [, url] = decodeURIComponent(state.url).split('/');
return `/${url}` === publicPageRoute;
})
) { ) {
resolve(true); resolve(true);
return EMPTY; return EMPTY;

Loading…
Cancel
Save