right way to throw error with server action
Answered
African Slender-snouted Crocodil… posted this in #help-forum
African Slender-snouted CrocodileOP
const loginAction = actionClient
.schema(loginSchema)
.action(async ({ parsedInput }) => {
const supabase = await createClient();
const { error } = await supabase.auth.signInWithPassword(parsedInput);
if (error) {
return { failure: error.message };
}
redirect("/dashboard");
});
so guys i am just asking if this is a good way to throw error using server action
Answered by B33fb0n3