perbaikan email dan password

This commit is contained in:
AJISETIAJI
2025-06-05 21:05:25 +07:00
parent 9f7556b11d
commit e2b6b487db

View File

@@ -232,11 +232,17 @@
if (error) throw error; if (error) throw error;
} else { } else {
// valid password tidak boleh kosong
if (!newUser.password || newUser.password.trim() === "") {
alert("Password is required for new users.");
return;
}
// 1. Create user in Supabase Auth // 1. Create user in Supabase Auth
const { data: authUser, error: authError } = const { data: authUser, error: authError } =
await supabase.auth.signUp({ await supabase.auth.signUp({
email: newUser.email, email: newUser.email,
password: newUser.nip || "defaultPassword123", // Use NIP as password or fallback password: newUser.password, // Use NIP as password or fallback
}); });
if (authError) throw authError; if (authError) throw authError;