Skip to content

Redirect to the original url on sign-in callback #340

@tmokmss

Description

@tmokmss

We can improve the below scenario:

  1. User access a webapp session URL
  2. Auth is expired, redirecting to sign-in page
  3. User signs in
  4. It now redirects to the root page instead of the url from step1

To improve this, we should store the URL in localStorage on redirect in step2, and restore it on another redircet on step4.

Redirect(step2) happens on Next.js middleware, so we can pass the original URL with HTTP header, and storing the URL in sign-in page. After a sucessful sign-in, it's always redirected to auth-callback page first. In the page we read the storage and redirect to the saved URL instead of root page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions