Hi! i want to redirect the user to the dashboard page once they login. how can i do this?
export default function Index() {
const { supabase } = useOutletContext();
const handleLogin = async () => {
const { data, error } = await supabase.auth.signInWithPassword({
email: "email",
password: "password",
});
if (!error) {
//redirect dashboard
}
};
return <button onClick={handleLogin}>Login</button>;
}