Skip to content

Commit cc5e50f

Browse files
Merge pull request #516 from ThaminduDilshan/thamindu-ct
Fix OAuth redirection handling in invite flow
2 parents a63b732 + ad7a9f1 commit cc5e50f

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

‎.changeset/three-flowers-sneeze.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@asgardeo/react': patch
3+
---
4+
5+
Fix OAuth redirection handling in invite flow

‎packages/react/src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.tsx‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,15 @@ const BaseAcceptInvite: FC<BaseAcceptInviteProps> = ({
634634

635635
await setChallengeToken(response.challengeToken ?? null);
636636

637+
if (response.type === 'REDIRECTION') {
638+
const redirectURL: any = response.data?.redirectURL || (response as any)?.redirectURL;
639+
640+
if (redirectURL && typeof window !== 'undefined') {
641+
initiateOAuthRedirect(redirectURL);
642+
return;
643+
}
644+
}
645+
637646
// Check for error (invalid token)
638647
if (response.flowStatus === 'ERROR') {
639648
setIsTokenInvalid(true);

0 commit comments

Comments
 (0)