Skip to content

Commit 904207b

Browse files
Merge pull request asgardeo#375 from ThaminduDilshan/thamindu-fail
Handle failure reason with incomplete flow response
2 parents 103b83d + ee7d5f0 commit 904207b

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

.changeset/public-suns-tickle.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+
Handle failure reason from flow execution response

packages/react/src/components/presentation/auth/SignIn/v2/SignIn.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,11 @@ const SignIn: FC<SignInProps> = ({
546546
setIsFlowInitialized(true);
547547
// Clean up flowId from URL after setting it in state
548548
cleanupFlowUrlParams();
549+
550+
// Display failure reason from INCOMPLETE response
551+
if ((response as any)?.failureReason) {
552+
setFlowError(new Error((response as any).failureReason));
553+
}
549554
}
550555
} catch (error) {
551556
const err: any = error as any;

0 commit comments

Comments
 (0)