1
0
Fork 0

edit regex validation

master
Matthew 2022-03-01 19:54:56 -05:00
parent 6958d4d6b1
commit 48e5579a8c
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 1 additions and 3 deletions

View File

@ -20,7 +20,6 @@ export default class CWG_SelfService extends Command {
}
public async run(message: Message, args: string[]) {
console.log(args);
const reqDomain = `${escape(args[0])}.cloud.libraryofcode.org`;
try {
@ -114,8 +113,7 @@ export default class CWG_SelfService extends Command {
}
public domainTextValidation(domain: string) {
if (/[^\w\s-]/.test(domain.trim().toLowerCase())) return false;
return true;
return /[A-Za-z0-9](?:[A-Za-z0-9-]{0,19}[A-Za-z0-9])?/.test(domain);
}
public async checkAuthorizationToken(userID: string, token: string) {