-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
SvelteKitError: Not found: /signin/google when using SvelteKit 5 #12829
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
Comments
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 |
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. There must be something wrong with the button or settings? |
Yeah. For now, we can replace the buttons with links to |
This seems to be related to #12775. I was able to roll back to 1.7.4. |
Ran into this. Wasn't very fun to troubleshoot. |
You can make a custom button for signin: <!-- button to sign in with Google -->
<script>
import { onMount } from "svelte";
let callbackUrl = "/";
let action = "/auth/signin/google";
onMount(() => {
// called when component loads
callbackUrl = window.location.origin;
action = window.location.origin + "/auth/signin/google";
});
export let customText = "";
</script>
<form action={action} method="POST">
<input type="hidden" name="csrfToken" />
<input type="hidden" name="callbackUrl" value={callbackUrl} />
<button type="submit">
{#if customText}
{customText}
{:else}
Sign in with Google
{/if}
</button>
</form>
<style>
button {
padding: 5px 10px;
}
</style> I am copying the form from the source code of Edit: here I do the same thing with signOut: <!-- button to sign out -->
<script>
import { onMount } from "svelte";
let action = "/auth/signout";
onMount(() => {
// called when component loads
action = window.location.origin + "/auth/signout";
});
export let customText = "Sign Out";
</script>
<form action={action} method="POST">
<input type="hidden" name="csrfToken"/>
<button id="submitButton" type="submit">
{customText}
</button>
</form>
<style>
button {
padding: 5px 10px;
}
</style> |
Environment
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/sveltekit@0.3.14
How to reproduce
https://github.com/rahulserver/gAuthDemoAppSveltekit
(SvelteKit 4 + Auth.js 0.3.x — working)
upgrade:
package.json:
Expected behavior
signIn('google') should redirect to /api/auth/signin/google and initiate OAuth flow.
The text was updated successfully, but these errors were encountered: