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

SvelteKitError: Not found: /signin/google when using SvelteKit 5 #12829

Open
mikeh2 opened this issue Mar 30, 2025 · 4 comments · May be fixed by #12846
Open

SvelteKitError: Not found: /signin/google when using SvelteKit 5 #12829

mikeh2 opened this issue Mar 30, 2025 · 4 comments · May be fixed by #12846
Labels
bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@mikeh2
Copy link

mikeh2 commented Mar 30, 2025

Environment

System:
OS: macOS 15.3.1
CPU: (14) arm64 Apple M4 Pro
Memory: 316.67 MB / 48.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 23.6.0 - ~/.nvm/versions/node/v23.6.0/bin/node
npm: 11.2.0 - ~/.nvm/versions/node/v23.6.0/bin/npm
Browsers:
Brave Browser: 132.1.74.51
Chrome: 134.0.6998.166
Safari: 18.3
npmPackages:
@auth/core: ^0.38.0 => 0.38.0
@auth/sveltekit: ^1.8.0 => 1.8.0

svelte@^5.0.0
@sveltejs/kit@next
@auth/[email protected]
@auth/[email protected]
Dev server using lvh.me over HTTPS
No manual /signin/google route defined

Reproduction URL

https://github.com/rahulserver/gAuthDemoAppSveltekit

Describe the issue

After upgrading to SvelteKit 5 (svelte@^5.0.0, @sveltejs/kit@next) and using @auth/sveltekit@^1.8.0, the Auth.js handler fails to register its internal routes.

Calling signIn('google') results in:

SvelteKitError: Not found: /signin/google
❗️The same code works in SvelteKit 4 with @auth/[email protected]

How to reproduce

https://github.com/rahulserver/gAuthDemoAppSveltekit
(SvelteKit 4 + Auth.js 0.3.x — working)

upgrade:
package.json:

"devDependencies": {
		"@sveltejs/adapter-auto": "latest",
		"@sveltejs/kit": "^2.16.0",
		"svelte": "^5.25.3",
		"vite": "^6.0.0"
	},
	"type": "module",
	"dependencies": {
		"@auth/core": "^0.38.0",
		"@auth/sveltekit": "^1.8.0"
	}
import { SvelteKitAuth } from "@auth/sveltekit"
import {AUTH_SECRET, GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET} from "$env/static/private"
import Google from "@auth/core/providers/google";
// export const handle = SvelteKitAuth({ providers: [Google({ clientId: GOOGLE_CLIENT_ID, clientSecret: GOOGLE_CLIENT_SECRET })] });

export const { handle } = SvelteKitAuth({
  providers: [
    Google({
      clientId: GOOGLE_CLIENT_ID,
      clientSecret: GOOGLE_CLIENT_SECRET
    }),
  ],
  secret: AUTH_SECRET,
  trustHost: true,
});

Expected behavior

signIn('google') should redirect to /api/auth/signin/google and initiate OAuth flow.

@mikeh2 mikeh2 added bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Mar 30, 2025
@yikuansun
Copy link

Same here. Interestingly enough, I'm still on Svelte 4 and didn't ever upgrade my dependencies (as far as I can recall)... will have to look into when the bug started appearing for me

@leon
Copy link

leon commented Apr 3, 2025

The button is generating a /signin/${providerId} but the actual default is /auth/signin/${providerId}

if I go to /auth/signin I get shown a list of all providers.
so it's routed correctly.

There must be something wrong with the button or settings?

@yikuansun
Copy link

Yeah. For now, we can replace the buttons with links to /auth/signin and /auth/signout, but they will take the user to signin/signout pages instead of immediately updating the auth.

@Octogonapus
Copy link

This seems to be related to #12775. I was able to roll back to 1.7.4.

@printharsh printharsh linked a pull request Apr 4, 2025 that will close this issue
3 tasks
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

Successfully merging a pull request may close this issue.

4 participants