fix: org username check for dynamic and signup (#11390)
This commit is contained in:
1 parent
7beb9568ba
commit
7154349e9e
3 files changed
+12
-4
No files matched your search
@@ -9,7 +9,9 @@ export const validateUsername = async (username: string, email: string, organiza
|
||||
where: {
|
||||
...(organizationId ? { organizationId } : {}),
|
||||
OR: [
|
||||
{ username },
|
||||
// When inviting to org, invited user gets created with username now, so in an org context we
|
||||
// can't check for username as it will exist on signup
|
||||
...(!organizationId ? [{ username }] : [{}]),
|
||||
{
|
||||
AND: [
|
||||
{ email },
|
||||
|
||||
Reference in new issue
Block a user