chore: Support already initiated flow in '@asgardeo/react' <SignIn/>#229
chore: Support already initiated flow in '@asgardeo/react' <SignIn/>#229DonOmalVindula merged 1 commit intoasgardeo:mainfrom
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.
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.
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(); |
There was a problem hiding this comment.
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.
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.
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