Skip to content

Instantly share code, notes, and snippets.

@richardherbert
Created January 13, 2026 14:31
Show Gist options
  • Select an option

  • Save richardherbert/f89f44066ca196d32ca0fbe58b0f2b77 to your computer and use it in GitHub Desktop.

Select an option

Save richardherbert/f89f44066ca196d32ca0fbe58b0f2b77 to your computer and use it in GitHub Desktop.
src/routes/signin/+page.server.js
// src/routes/signin/+page.server.js
import { redirect } from '@sveltejs/kit';
import { supabase } from '$lib/supabaseClient';
export const actions = {
default: async ( { request } ) => {
const form = await request.formData();
const email = form.get( 'email' );
const password = form.get( 'password' );
const { data, error } = await supabase.auth.signInWithPassword( {
email: email,
password: password
} );
if( error ) {
redirect( 303, '/signin' );
}
redirect( 303, '/secure/players' );
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment