Skip to content

Return to target page after login #359

Closed as not planned
Closed as not planned

Description

@david-crespo

Often users will attempt to navigate to or refresh a page after their session has run out (or they never had one). Redirecting to login is trivial, but after successful login we want to take the user back to the page they were on. In order to do that, we need to hold onto the original path while they log in. This can be done in a few ways:

  • next or redirect arg in query string
  • cookie or local storage
  • use Referer header on request to login route

I like the query string option. Cookie and local storage make me nervous because they're opaque to the user and you have to worry about expiration.

We can't use Referer properly because routing is (at least sometimes) client-side, so there are no request headers. We could use a referrer key on the React Router redirect to prop, but to me that's just a more opaque and less reliable version of using the query string.

Activity

  1. david-crespo commented on Mar 26, 2022

    @david-crespo
    CollaboratorAuthor

    Most of the work here is on the Nexus side in the IdP integration, but we do have to pass the right query param to /login, and this issue is still a good place to track this idea overall.

  2. david-crespo commented on Jul 5, 2022

    @david-crespo
    CollaboratorAuthor

    Closing for now. The work here is on the Nexus side. We're not going to get elaborate yet about using a cookie to know which IdP to send them to. We might not even need anything like that if different silos get different subdomains or something.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions