Skip to content

Conversation

@senthalan
Copy link
Contributor

@senthalan senthalan commented Oct 31, 2025

Purpose

Support already initiated flow in '@asgardeo/react'

Priority: flowId(from URL) > applicationId (from context) > applicationId (from URL)

Related Issues

  • N/A

Related PRs

  • N/A

Checklist

  • Followed the CONTRIBUTING guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Unit tests provided. (Add links if there are any)

Security checks

@senthalan senthalan requested a review from Copilot October 31, 2025 06:42

import {FC, useState, useEffect, useRef, ReactNode} from 'react';
import BaseSignIn, {BaseSignInProps} from './BaseSignIn';
import { FC, useState, useEffect, useRef, ReactNode } from 'react';
Copy link
Contributor

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.

Suggested change
import { FC, useState, useEffect, useRef, ReactNode } from 'react';
import {FC, useState, useEffect, useRef, ReactNode} from 'react';

Copy link

Copilot AI left a 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 flowId URL parameter with priority handling (flowId > context applicationId > URL applicationId)
  • Refactored flow initialization logic to conditionally use flowId or applicationId when calling the signIn function
  • 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.

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();
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable baseUrl.

Suggested change
const { applicationId, afterSignInUrl, signIn, isInitialized, isLoading, baseUrl } = useAsgardeo();
const { applicationId, afterSignInUrl, signIn, isInitialized, isLoading } = useAsgardeo();

Copilot uses AI. Check for mistakes.
@senthalan senthalan force-pushed the main branch 2 times, most recently from ab69e47 to f6f8929 Compare October 31, 2025 06:47
@senthalan senthalan requested a review from Copilot October 31, 2025 06:47
Copy link

Copilot AI left a 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.

Comment on lines 192 to 194
const urlParams = new URL(window.location.href).searchParams;
const flowIdFromUrl = urlParams.get('flowId');
const applicationIdFromUrl = urlParams.get('applicationId');
Copy link
Contributor

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

Suggested change
const urlParams = new URL(window.location.href).searchParams;
const flowIdFromUrl = urlParams.get('flowId');
const applicationIdFromUrl = urlParams.get('applicationId');
const applicationIdFromUrl: string = urlParams.get('applicationId');

@asgardeo-github-bot
Copy link

🦋 Changeset detected

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

@DonOmalVindula DonOmalVindula merged commit 5aee0d0 into asgardeo:main Oct 31, 2025
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants