From 25f4062ccb931b646aa44490d0b1b126c6fbef63 Mon Sep 17 00:00:00 2001 From: thiva-k Date: Thu, 5 Feb 2026 23:50:44 +0530 Subject: [PATCH 1/2] Update oauth callback url --- packages/javascript/src/api/v2/executeEmbeddedSignInFlowV2.ts | 4 ++-- packages/javascript/src/api/v2/executeEmbeddedSignUpFlowV2.ts | 4 ++-- packages/javascript/src/models/v2/embedded-flow-v2.ts | 2 +- .../src/components/presentation/auth/SignIn/v2/SignIn.tsx | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/javascript/src/api/v2/executeEmbeddedSignInFlowV2.ts b/packages/javascript/src/api/v2/executeEmbeddedSignInFlowV2.ts index 991af3fc..2567a604 100644 --- a/packages/javascript/src/api/v2/executeEmbeddedSignInFlowV2.ts +++ b/packages/javascript/src/api/v2/executeEmbeddedSignInFlowV2.ts @@ -93,10 +93,10 @@ const executeEmbeddedSignInFlowV2 = async ({ const flowResponse: EmbeddedSignInFlowResponseV2 = await response.json(); // IMPORTANT: Only applicable for Asgardeo V2 platform. - // Check if the flow is complete and has an assertion and authId is provided, then call OAuth2 authorize. + // Check if the flow is complete and has an assertion and authId is provided, then call OAuth2 auth callback. if (flowResponse.flowStatus === EmbeddedSignInFlowStatusV2.Complete && (flowResponse as any).assertion && authId) { try { - const oauth2Response: Response = await fetch(`${baseUrl}/oauth2/authorize`, { + const oauth2Response: Response = await fetch(`${baseUrl}/oauth2/auth/callback`, { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/packages/javascript/src/api/v2/executeEmbeddedSignUpFlowV2.ts b/packages/javascript/src/api/v2/executeEmbeddedSignUpFlowV2.ts index 67bfd83e..07f90f0e 100644 --- a/packages/javascript/src/api/v2/executeEmbeddedSignUpFlowV2.ts +++ b/packages/javascript/src/api/v2/executeEmbeddedSignUpFlowV2.ts @@ -93,10 +93,10 @@ const executeEmbeddedSignUpFlowV2 = async ({ const flowResponse: EmbeddedSignUpFlowResponseV2 = await response.json(); // IMPORTANT: Only applicable for Asgardeo V2 platform. - // Check if the flow is complete and has an assertion and authId is provided, then call OAuth2 authorize. + // Check if the flow is complete and has an assertion and authId is provided, then call OAuth2 auth callback. if (flowResponse.flowStatus === EmbeddedSignUpFlowStatusV2.Complete && (flowResponse as any).assertion && authId) { try { - const oauth2Response: Response = await fetch(`${baseUrl}/oauth2/authorize`, { + const oauth2Response: Response = await fetch(`${baseUrl}/oauth2/auth/callback`, { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/packages/javascript/src/models/v2/embedded-flow-v2.ts b/packages/javascript/src/models/v2/embedded-flow-v2.ts index 9bae6ddf..0f9e21f4 100644 --- a/packages/javascript/src/models/v2/embedded-flow-v2.ts +++ b/packages/javascript/src/models/v2/embedded-flow-v2.ts @@ -398,7 +398,7 @@ export interface EmbeddedFlowExecuteRequestConfig extends EmbeddedFlowE * * When the embedded flow completes successfully and returns an assertion, * this authId is used to complete the OAuth2 authorization flow by calling - * the `/oauth2/authorize` endpoint. This enables seamless transition from + * the `/oauth2/auth/callback` endpoint. This enables seamless transition from * embedded flow to traditional OAuth2 flow completion. * * @example "auth_abc123def456" diff --git a/packages/react/src/components/presentation/auth/SignIn/v2/SignIn.tsx b/packages/react/src/components/presentation/auth/SignIn/v2/SignIn.tsx index 49865958..fbe5d1b3 100644 --- a/packages/react/src/components/presentation/auth/SignIn/v2/SignIn.tsx +++ b/packages/react/src/components/presentation/auth/SignIn/v2/SignIn.tsx @@ -505,7 +505,7 @@ const SignIn: FC = ({className, size = 'medium', onSuccess, onError } if (response.flowStatus === EmbeddedSignInFlowStatusV2.Complete) { - // Get redirectUrl from response (from /oauth2/authorize) or fall back to afterSignInUrl + // Get redirectUrl from response (from /oauth2/auth/callback) or fall back to afterSignInUrl const redirectUrl = (response as any)?.redirectUrl || (response as any)?.redirect_uri; const finalRedirectUrl = redirectUrl || afterSignInUrl; From 481f0021378b4367e7a0c539cd25c7b455fd4557 Mon Sep 17 00:00:00 2001 From: thiva-k Date: Thu, 5 Feb 2026 23:57:46 +0530 Subject: [PATCH 2/2] Add changeset --- .changeset/yellow-squids-learn.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/yellow-squids-learn.md diff --git a/.changeset/yellow-squids-learn.md b/.changeset/yellow-squids-learn.md new file mode 100644 index 00000000..7385ca4d --- /dev/null +++ b/.changeset/yellow-squids-learn.md @@ -0,0 +1,6 @@ +--- +'@asgardeo/javascript': minor +'@asgardeo/react': minor +--- + +Update post login/signin callback url for V2