-
Notifications
You must be signed in to change notification settings - Fork 41
chore: Support already initiated flow in '@asgardeo/react' <SignIn/> #229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| import {FC, useState, useEffect, useRef, ReactNode} from 'react'; | ||
| import BaseSignIn, {BaseSignInProps} from './BaseSignIn'; | ||
| import { FC, useState, useEffect, useRef, ReactNode } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's fix these spacing issues.
| import { FC, useState, useEffect, useRef, ReactNode } from 'react'; | |
| import {FC, useState, useEffect, useRef, ReactNode} from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for resuming already-initiated authentication flows in the @asgardeo/react SignIn component. The component now accepts a flowId URL parameter to continue an existing flow, in addition to the existing applicationId parameter for starting new flows.
Key changes:
- Added support for
flowIdURL parameter with priority handling (flowId > context applicationId > URL applicationId) - Refactored flow initialization logic to conditionally use
flowIdorapplicationIdwhen calling thesignInfunction - Updated import statements and destructuring syntax for consistent code formatting
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/react/src/components/presentation/SignIn/component-driven/SignIn.tsx | Added flowId support and priority logic for resuming existing authentication flows; formatted imports for consistency |
| .changeset/wild-deer-swim.md | Added changeset documentation for the new feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/react/src/components/presentation/SignIn/component-driven/SignIn.tsx
Show resolved
Hide resolved
| const {applicationId, afterSignInUrl, signIn, isInitialized, isLoading, baseUrl} = useAsgardeo(); | ||
| const {t} = useTranslation(); | ||
| const SignIn: FC<SignInProps> = ({ className, size = 'medium', onSuccess, onError, variant, children }) => { | ||
| const { applicationId, afterSignInUrl, signIn, isInitialized, isLoading, baseUrl } = useAsgardeo(); |
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable baseUrl.
| const { applicationId, afterSignInUrl, signIn, isInitialized, isLoading, baseUrl } = useAsgardeo(); | |
| const { applicationId, afterSignInUrl, signIn, isInitialized, isLoading } = useAsgardeo(); |
ab69e47 to
f6f8929
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/react/src/components/presentation/SignIn/component-driven/SignIn.tsx
Show resolved
Hide resolved
| const urlParams = new URL(window.location.href).searchParams; | ||
| const flowIdFromUrl = urlParams.get('flowId'); | ||
| const applicationIdFromUrl = urlParams.get('applicationId'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add types for these as well
| const urlParams = new URL(window.location.href).searchParams; | |
| const flowIdFromUrl = urlParams.get('flowId'); | |
| const applicationIdFromUrl = urlParams.get('applicationId'); | |
| const applicationIdFromUrl: string = urlParams.get('applicationId'); |
🦋 Changeset detectedThe changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. |
Purpose
Support already initiated flow in '@asgardeo/react'
Priority: flowId(from URL) > applicationId (from context) > applicationId (from URL)
Related Issues
Related PRs
Checklist
Security checks