Skip to content

Commit dbd242c

Browse files
committed
fix(react): update platform condition for Asgardeo V2 in authentication flow
1 parent 218f930 commit dbd242c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/react/src/AsgardeoReactClient.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,12 @@ class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactConfig> e
335335

336336
const config: AsgardeoReactConfig = (await this.asgardeo.getConfigData()) as AsgardeoReactConfig;
337337

338-
if (config.platform === Platform.AsgardeoV2 && typeof arg1 === 'object' && !isEmpty(arg1)) {
338+
if (
339+
config.platform === Platform.AsgardeoV2 &&
340+
typeof arg1 === 'object' &&
341+
!isEmpty(arg1) &&
342+
('flowId' in arg1 || 'applicationId' in arg1)
343+
) {
339344
const sessionDataKey: string = new URL(window.location.href).searchParams.get('sessionDataKey');
340345

341346
return executeEmbeddedSignInFlowV2({

packages/react/src/contexts/Asgardeo/AsgardeoProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ const AsgardeoProvider: FC<PropsWithChildren<AsgardeoProviderProps>> = ({
257257

258258
// TEMPORARY: Asgardeo V2 platform does not support SCIM2, Organizations endpoints yet.
259259
// Tracker: https://github.com/asgardeo/javascript/issues/212
260-
if (config.platform !== Platform.AsgardeoV2) {
260+
if (config.platform === Platform.AsgardeoV2) {
261261
setUser(extractUserClaimsFromIdToken(decodedToken));
262262
} else {
263263
try {

0 commit comments

Comments
 (0)