diff --git a/.changeset/three-flowers-sneeze.md b/.changeset/three-flowers-sneeze.md new file mode 100644 index 000000000..246972172 --- /dev/null +++ b/.changeset/three-flowers-sneeze.md @@ -0,0 +1,5 @@ +--- +'@asgardeo/react': patch +--- + +Fix OAuth redirection handling in invite flow diff --git a/packages/react/src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.tsx b/packages/react/src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.tsx index 61402fe31..f32d45a7b 100644 --- a/packages/react/src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.tsx +++ b/packages/react/src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.tsx @@ -634,6 +634,15 @@ const BaseAcceptInvite: FC = ({ await setChallengeToken(response.challengeToken ?? null); + if (response.type === 'REDIRECTION') { + const redirectURL: any = response.data?.redirectURL || (response as any)?.redirectURL; + + if (redirectURL && typeof window !== 'undefined') { + initiateOAuthRedirect(redirectURL); + return; + } + } + // Check for error (invalid token) if (response.flowStatus === 'ERROR') { setIsTokenInvalid(true);