Skip to content

Commit

Permalink
fix: Invalid CanActivate guard in cmsMapping (#19265)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpawelczak authored Sep 27, 2024
1 parent 2672319 commit 3cbda23
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { Injectable, inject } from '@angular/core';
import { inject, Injectable } from '@angular/core';
import { CanActivateFn, RouterStateSnapshot, UrlTree } from '@angular/router';
import {
CmsActivatedRouteSnapshot,
FeatureConfigService,
UnifiedInjector,
getLastValueSync,
UnifiedInjector,
wrapIntoObservable,
} from '@spartacus/core';
import { Observable, concat, of } from 'rxjs';
import { concat, Observable, of } from 'rxjs';
import { endWith, first, skipWhile } from 'rxjs/operators';
import { CmsComponentsService } from './cms-components.service';
import { CanActivate, GuardsComposer } from './guards-composer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,13 @@ export class CmsRoutesImplService {
}

if (route?.canActivate?.length) {
route.canActivate = route.canActivate.map((guard) =>
const canActivate = route.canActivate.map((guard) =>
this.wrapCmsGuard(guard)
);
return {
...route,
canActivate,
};
}

return route;
Expand Down

0 comments on commit 3cbda23

Please sign in to comment.