Skip to content

Commit 27ead4c

Browse files
committed
Merge branch 'epic/punchout' into feature/CXSPA-10011
2 parents a053dcf + 54968dc commit 27ead4c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

integration-libs/punchout/core/facade/punchout.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class PunchoutService implements PunchoutFacade {
7272
return throwError(() => new Error('Punchout Session Id missing'));
7373
}
7474

75-
return this.punchoutAuthService.silentLogout().pipe(
75+
return this.punchoutAuthService.silentLogout(payload?.isPageRefresh).pipe(
7676
switchMap(() => this.requestPunchoutSession(payload.punchoutSessionId)),
7777
map((punchoutSession) => {
7878
if (punchoutSession?.token?.accessToken) {

integration-libs/punchout/core/services/punchout-auth.service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,13 @@ export class PunchoutAuthService {
3939
protected punchoutDetectionService = inject(PunchoutDetectionService);
4040
protected routingService = inject(RoutingService);
4141

42-
silentLogout(): Observable<boolean> {
42+
silentLogout(isPageRefresh = false): Observable<boolean> {
4343
return this.isUserLoggedIn().pipe(
44-
tap(() => this.punchoutStoreService.clearPunchoutState()),
44+
tap(() => {
45+
if (!isPageRefresh) {
46+
this.punchoutStoreService.clearPunchoutState();
47+
}
48+
}),
4549
switchMap((isLoggedIn) => {
4650
return isLoggedIn
4751
? from(this.authService.coreLogout()).pipe(

0 commit comments

Comments
 (0)