Skip to content

Return to target page after login #359

@david-crespo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions