Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
♻️ Remove username validation
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Sep 3, 2020
1 parent 4f450a4 commit 3fac6c9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/_staart/services/group.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ export const createDomain = async (domain: domainsCreateInput) => {
};

/**
* Get a user by their username
* Check if a domain is available
*/
export const checkDomainAvailability = async (username: string) => {
export const checkDomainAvailability = async (domainName: string) => {
try {
const domain = await getDomainByDomainName(username);
const domain = await getDomainByDomainName(domainName);
if (domain && domain.id) return false;
} catch (error) {}
return true;
Expand Down
1 change: 0 additions & 1 deletion src/controllers/groups/_id/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export class GroupController {
validator(
{
name: Joi.string(),
username: Joi.string().regex(/^[a-z0-9\-]+$/i),
forceTwoFactor: Joi.boolean(),
autoJoinDomain: Joi.boolean(),
onlyAllowDomain: Joi.boolean(),
Expand Down
1 change: 0 additions & 1 deletion src/controllers/users/_id/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export class UserController {
name: Joi.string()
.min(3)
.regex(/^[a-zA-Z ]*$/),
username: Joi.string().regex(/^[a-z0-9\-]+$/i),
nickname: Joi.string(),
primaryEmail: [Joi.string(), Joi.number()],
countryCode: Joi.string().length(2),
Expand Down

0 comments on commit 3fac6c9

Please sign in to comment.