create user with signUpEmail

I'm trying to create an user on the server with auth.api.signUpEmail I can get the response object, but the user is not inserted in the database:
let result;

try {

const response = await auth.api.signUpEmail({
body: {
password: 'admin1234',
name: 'admin',
},
});

console.log(response)

result = response;

} catch (error) {
await connection.rollback();
console.error('An error occurred during the app_users insertion process:', error);
}
let result;

try {

const response = await auth.api.signUpEmail({
body: {
password: 'admin1234',
name: 'admin',
},
});

console.log(response)

result = response;

} catch (error) {
await connection.rollback();
console.error('An error occurred during the app_users insertion process:', error);
}
2 Replies
Henry
Henry2w ago
To get an actual response (not just data) you need to include asResponse: true :
const response = await auth.api.signInEmail({
body: {
email: "",
password: ""
},
asResponse: true
})
const response = await auth.api.signInEmail({
body: {
email: "",
password: ""
},
asResponse: true
})
This may give you more information as to the issue.
rhitune
rhitune2w ago
and maybe const { data , error } =

Did you find this page helpful?