Skip to content

Commit 75c0bf0

Browse files
committed
fix: session-logout-logic
1 parent 3d6308f commit 75c0bf0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.changeset/cool-ligers-dress.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@forgerock/javascript-sdk': patch
3+
---
4+
5+
fix logic for when we should call session revoke

packages/javascript-sdk/src/fr-user/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import TokenManager from '../token-manager';
1818
import type { LogoutOptions } from '../oauth2-client/interfaces';
1919
import Config from '../config';
2020
import TokenStorage from '../token-storage';
21-
import { getEndpointPath } from '../util/url';
2221

2322
/**
2423
* High-level API for logging a user in/out and getting profile information.
@@ -49,9 +48,9 @@ abstract class FRUser {
4948
// Shallow copy options to delete redirect prop
5049
const configOptions = { ...options };
5150
delete configOptions.redirect;
52-
const { realmPath, serverConfig } = Config.get(configOptions);
51+
const { serverConfig } = Config.get(configOptions);
5352

54-
if (getEndpointPath('sessions', realmPath, serverConfig.paths)) {
53+
if (!serverConfig.paths || (serverConfig.paths && 'sessions' in serverConfig.paths)) {
5554
// Just log any exceptions that are thrown, but don't abandon the flow
5655
try {
5756
// Both invalidates the session on the server AND removes browser cookie

0 commit comments

Comments
 (0)