perbaikan email dan password
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user