While working on my Next.js project, I encountered an issue when trying to create a user using the supabase.auth.admin.createUser() method. The error message I received was:
{
message: "Database error creating new user"
name: "AuthApiError",
status: 500,
}
Here is the code snippet I used:
const { data, error } = await supabaseAdmin.auth.admin.createUser({
email: email,
password: password,
user_metadata: {
nickname: nickname,
introduce: introduce,
},
});
I have verified that the email, password, nickname, and introduce variables have correct values and data types. Additionally, I have confirmed that I am using the correct supabase instance with the right supabaseUrl and supabaseServiceRoleKey.
I am interested in receiving a more specific error message other than "Database error creating new user" or any guidance on how to resolve this issue.