Skip to content

Commit 6797de0

Browse files
committed
refactor(discord-bot): consolidate Validator vs Utils license key rules
1 parent 9e413c7 commit 6797de0

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/utils/Utils.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const crypto = require('crypto');
2+
const Validator = require('./Validator');
23

34
class Utils {
45
static validateEmail(email) {
@@ -7,7 +8,12 @@ class Utils {
78
}
89

910
static validateLicenseKey(licenseKey) {
10-
return licenseKey.length === 32 && /^[A-Z0-9]+$/.test(licenseKey);
11+
try {
12+
Validator.validateLicenseKey(licenseKey);
13+
return true;
14+
} catch {
15+
return false;
16+
}
1117
}
1218

1319
static validateUuid(uuid) {

0 commit comments

Comments
 (0)