javascript icon indicating copy to clipboard operation
javascript copied to clipboard

Clerk doesn't follow `redirect_url` search parameter when refreshing page

Open IGassmann opened this issue 1 year ago • 1 comments

Preliminary Checks

  • [X] I have reviewed the documentation: https://clerk.com/docs
  • [X] I have searched for existing issues: https://github.com/clerk/javascript/issues
  • [X] I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
  • [X] This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.

Reproduction / Replay Link

https://github.com/IGassmann/clerk-redirect-url-reproduction

Publishable key

pk_test_c2V0dGxlZC1oYXdrLTUzLmNsZXJrLmFjY291bnRzLmRldiQ

Description

Steps to reproduce:

  1. Open http://localhost:3000/sign-in and sign in
  2. Open a second tab and go to http://localhost:3000/dashboard/target
  3. Sign out on the first tab (you will get redirected to http://localhost:3000/sign-in)
  4. Switch to the second tab (you will get auto-redirected to http://localhost:3000/sign-in?redirect_url=http%3A%2F%2Flocalhost%3A3000%2Fdashboard%2Ftarget)
  5. Sign in on the first tab
  6. Refresh the second tab (you will get redirected to http://localhost:3000/)

Expected behavior:

The user should have been redirected to http://localhost:3000/dashboard/target on step 6.

Actual behavior:

The user was redirected to http://localhost:3000/ on step 6.

Environment

System:
    OS: macOS 14.1.2
    CPU: (12) arm64 Apple M2 Pro
    Memory: 1.44 GB / 32.00 GB
    Shell: 3.6.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 18.18.0 - ~/Library/Caches/fnm_multishells/39738_1703237691322/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.8.1 - ~/Library/Caches/fnm_multishells/39738_1703237691322/bin/npm
    pnpm: 8.6.2 - ~/Library/Caches/fnm_multishells/39738_1703237691322/bin/pnpm
  Browsers:
    Chrome: 120.0.6099.129
    Safari: 17.1.2
  npmPackages:
    @clerk/nextjs: ^4.21.8 => 4.21.8
    @types/node: 20.1.4 => 20.1.4
    @types/react: 18.2.6 => 18.2.6
    @types/react-dom: 18.2.4 => 18.2.4
    autoprefixer: 10.4.14 => 10.4.14
    classnames: ^2.3.2 => 2.3.2
    next: 13.4.2 => 13.4.2
    postcss: 8.4.23 => 8.4.23
    react: 18.2.0 => 18.2.0
    react-dom: 18.2.0 => 18.2.0
    tailwindcss: 3.3.2 => 3.3.2
    typescript: 5.0.4 => 5.0.4

IGassmann avatar Dec 22 '23 10:12 IGassmann

I can give it a try

HusainBhattiwala avatar Feb 23 '24 04:02 HusainBhattiwala