Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SignInButton SignUpButton redirectUrl doesn't respect basePath #2645

Open
4 tasks done
xixixao opened this issue Jan 20, 2024 · 1 comment
Open
4 tasks done

SignInButton SignUpButton redirectUrl doesn't respect basePath #2645

xixixao opened this issue Jan 20, 2024 · 1 comment

Comments

@xixixao
Copy link

xixixao commented Jan 20, 2024

Preliminary Checks

Reproduction / Replay Link

https://github.com/xixixao/bug-clerk-next-redirectUrl

Publishable key

pk_test_cHJvcGVyLXdoaXBwZXQtNzcuY2xlcmsuYWNjb3VudHMuZGV2JA

Description

  1. Run npm run dev
  2. On the page, click on sign in or sign up
  3. Go through

This only works because I added the basePath configured in next.config.mjs to app/page.tsx to the redirectUrl props. But the this should not be needed, and the basePath should be taken into account automatically.

Environment

System:
    OS: macOS 14.2.1
    CPU: Apple M1
  Binaries:
    Node: 18.17.0 - ~/Library/Caches/fnm_multishells/2125_1705529595263/bin/node
    npm: 9.6.7 - ~/Library/Caches/fnm_multishells/2125_1705529595263/bin/npm
    pnpm: 8.7.4 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 120.0.6099.234
    Safari: 17.2.1
  npmPackages:
    @clerk/nextjs: ^4.29.4 => 4.29.4
    @types/node: ^20 => 20.11.5
    @types/react: ^18 => 18.2.48
    @types/react-dom: ^18 => 18.2.18
    autoprefixer: ^10.0.1 => 10.4.17
    eslint: ^8 => 8.56.0
    eslint-config-next: 14.1.0 => 14.1.0
    next: 14.1.0 => 14.1.0
    postcss: ^8 => 8.4.33
    react: ^18 => 18.2.0
    react-dom: ^18 => 18.2.0
    tailwindcss: ^3.3.0 => 3.4.1
    typescript: ^5 => 5.3.3
@xixixao xixixao added the needs-triage A ticket that needs to be triaged by a team member label Jan 20, 2024
@linear linear bot added confirmed and removed needs-triage A ticket that needs to be triaged by a team member labels Jan 29, 2024
@LekoArts
Copy link
Member

Hi, thanks for the issue!

To the best of our knowledge Next.js doesn't expose the basePath option to packages like Clerk so we can't support it. We'll give this some 30min or so to see if we could access it. Still, if we could do, it would be a breaking change.

For the time being I do recommend settings your base path in an environment variable or constant and use those across the config and paths.

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

No branches or pull requests

2 participants