Commit 44bd4eea by jaymehta

.

1 parent 032b169b
......@@ -65,7 +65,7 @@ const userPermissionExtension = (plugin) => {
{ username: email },
{ username },
{ email: username },
{phone: phone}
{ phone: phone },
],
};
const conflictingUserCount = await strapi
......@@ -73,12 +73,16 @@ const userPermissionExtension = (plugin) => {
.count({
where: { ...identifierFilter, provider },
});
const conflictingUser = await strapi
.query("plugin::users-permissions.user")
.findOne({ where: { ...identifierFilter } });
if (conflictingUserCount > 0) {
return ctx.send({
status: "fail",
message: "Email or phone number already taken.",
conflictingUserCount
identifierFilter,
conflictingUserCount,
conflictingUser,
});
}
......@@ -93,7 +97,9 @@ const userPermissionExtension = (plugin) => {
return ctx.send({
status: "fail",
message: "Email or phone number already taken.",
conflictingUserCount
identifierFilter,
conflictingUserCount,
conflictingUser,
});
}
}
......@@ -104,7 +110,7 @@ const userPermissionExtension = (plugin) => {
email: email,
username,
confirmed: false,
phone: phone
phone: phone,
};
const user = await strapi
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!