SupabaseS
Supabase•2y ago
DomNeuner

email & password auth with sveltekit

I'm creating a new project using sveltekit. In the past, I've used the Sveltekit Auth Helpers which now recommends using the SSR package instead.

I've followed that part and created the client but clicking through to Implementing authentication with Email and Password redirects me to a page that talks about just using email auth - https://supabase.com/docs/guides/auth/server-side/email-based-auth-with-pkce-flow-for-ssr ? No mention of passwords or handling that from a login form.

Am I missing something in the docs? I can't find anything under SSR that actually talks about using email & password 😅 Do I still setup a code exchange route like before and just handle login with something like this:

async function signInWithEmail() {
  const { data, error } = await supabase.auth.signInWithPassword({
    email: 'example@email.com',
    password: 'example-password'
  })
}
image.png
Convenience helpers for implementing user authentication in SvelteKit.
Learn how to configure email authentication in your server-side rendering (SSR) application to work with the PKCE flow.
Was this page helpful?