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

SvelteKit: only modify basePath in SvelteKitAuth cause incorrect URL #11584

Open
alissa-tung opened this issue Aug 12, 2024 · 0 comments
Open
Labels
bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@alissa-tung
Copy link

Environment

  System:
    OS: macOS 14.5
    CPU: (12) arm64 Apple M2 Max
    Memory: 48.61 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.3.0 - /nix/store/cpqfn567chsy7mslcfwnijsn6mq82lcq-nodejs-22.3.0/bin/node
    npm: 10.8.1 - /nix/store/cpqfn567chsy7mslcfwnijsn6mq82lcq-nodejs-22.3.0/bin/npm
    pnpm: 9.4.0 - /nix/store/9l6vfmlmfj1fm6bh3i41k9sd59xhkdci-pnpm-9.4.0/bin/pnpm
  Browsers:
    Chrome: 127.0.6533.100
    Safari: 17.5
  npmPackages:
    @auth/sveltekit: ^1.4.2 => 1.4.2

Reproduction URL

https://github.com/alissa-tung/bug-08-12

Describe the issue

the callback in OAuth app is

http://localhost:3000/api/auth/callback/github
  1. every login made redirection to /api/auth/callback/github, but /api/auth/callback/github is always not found, and the URL says redirect_uri_mismatch in search parameters
  2. there is nothing under /api/auth, but /auth/ and /auth/login did has response
  3. if OAuth is configured with http://localhost:3000/auth/callback/github, and remove the basePath, everything is okay

How to reproduce

  1. clone this repo
  2. make an OAuth app with http://localhost:3000/api/auth/callback/github
  3. pnpm dev --port 3000
  4. try login

Expected behavior

path under /api/auth should not be no found when basePath is configured, and anything /auth should be not found

@alissa-tung alissa-tung added bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

1 participant