Skip to content

Commit

Permalink
fix signin
Browse files Browse the repository at this point in the history
  • Loading branch information
craigkai committed Oct 7, 2024
1 parent 8ffa573 commit b4cdf60
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/routes/auth/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,12 @@ export const actions = {
const { error } = await supabase.auth.signInWithPassword({ email, password });

if (error) {
console.log(error);
return setError(form, 'email', error.message);
}

// Instead of returning the form directly, redirect or trigger a session update
// Option 1: Redirect after signing in
return { success: true, redirect: '/protected-routes/dashboard' };

// Option 2: You could set a session variable or state that the UI listens to
return { form, redirect: '/protected-routes/dashboard' };
},

resetpassword: async ({ request, locals: { supabase } }) => {
Expand Down

0 comments on commit b4cdf60

Please sign in to comment.