Skip to content

Conversation

@brionmario
Copy link
Member

@brionmario brionmario commented Oct 24, 2025

Purpose

This pull request introduces improvements to the ProtectedRoute component in @asgardeo/react-router, enhancing its flexibility and developer experience. The main changes allow ProtectedRoute to function without requiring props, add support for custom sign-in logic and parameters, and improve platform-specific handling in the Asgardeo React SDK.

ProtectedRoute enhancements:

  • The ProtectedRoute component now works without requiring any props, simplifying usage for default authentication flows.
  • Added new props to ProtectedRoute: onSignIn for custom sign-in logic and signInOptions for passing additional authorization parameters. This allows developers to override the default sign-in behavior and customize authentication requests. [1] [2]
  • The internal logic of ProtectedRoute has been updated to handle cases where a sign-in URL is available, invoke custom sign-in handlers, or use merged sign-in options. Improved error handling for misconfiguration is also included.

SDK/platform improvements:

  • In AsgardeoReactClient, embedded sign-in flow for Asgardeo V2 now checks for flowId or applicationId in the provided options before triggering the flow, ensuring more accurate platform handling.
  • In AsgardeoProvider, user claim extraction logic is updated to correctly handle Asgardeo V2 platform, improving compatibility with the latest platform features.

API exports:

  • The navigate utility is now re-exported from @asgardeo/browser in the React SDK, making it available for routing and navigation needs.

Related Issues

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

@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.

@brionmario brionmario merged commit 64f153b into asgardeo:main Oct 24, 2025
3 of 5 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