Created
January 13, 2026 14:31
-
-
Save richardherbert/f89f44066ca196d32ca0fbe58b0f2b77 to your computer and use it in GitHub Desktop.
src/routes/signin/+page.server.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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