Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jay Mehta
/
zango-strapi
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Registry
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 44bd4eea
authored
10 months ago
by
jaymehta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
.
1 parent
032b169b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
src/extensions/users-permissions/strapi-server.js
src/extensions/users-permissions/strapi-server.js
View file @
44bd4ee
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment