Skip to content

Redirect back to original secured route after login #385

Description

@sagara-gunathunga

Current Limitation

When using @asgardeo/react-router, navigating to a secured route without being logged in redirects the user to Asgardeo/IS for authentication.

After successful authentication, the user is redirected to the application root (/) instead of the originally requested secured route. This results in a poor user experience. Ideally, the user should be redirected back to the exact secured route they intended to access.

.

Suggested Improvement

This can be implemented without changes to Asgardeo/IS by leveraging the OAuth2 state parameter. The SDK can encode the currently active path in the state parameter (only if the route is valid and marked as secured) and restore it after successful authentication

Please select the package issue is related to

@asgardeo/react-router

Version

1.1.0

Reporter Checklist

  • I have searched the existing issues and this is not a duplicate.
  • I have provided all the necessary information.
  • I have verified the improvement is not available in the latest version of the package.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions