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