1
0
Fork 0
mirror of synced 2024-09-29 17:01:37 +13:00

Fix missing env

This commit is contained in:
Jake Barnby 2023-08-23 17:53:24 -04:00
parent 0f36245f78
commit 55deaec8b2
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
2 changed files with 6 additions and 2 deletions

View file

@ -85,13 +85,16 @@ App::post('/v1/account/invite')
$email = \strtolower($email);
$whitelistCodes = (!empty(App::getEnv('_APP_CONSOLE_WHITELIST_CODES', null))) ? \explode(',', App::getEnv('_APP_CONSOLE_WHITELIST_CODES', null)) : [];
$codes = App::getEnv('_APP_CONSOLE_WHITELIST_CODES');
$whitelistCodes = !empty($codes)
? \explode(',', $codes)
: [];
if (empty($whitelistCodes)) {
throw new Exception(Exception::GENERAL_CODES_DISABLED);
}
if (!empty($whitelistCodes) && !\in_array($code, $whitelistCodes)) {
if (!\in_array($code, $whitelistCodes)) {
throw new Exception(Exception::USER_INVALID_CODE);
}

View file

@ -100,6 +100,7 @@ services:
- _APP_CONSOLE_WHITELIST_ROOT
- _APP_CONSOLE_WHITELIST_EMAILS
- _APP_CONSOLE_WHITELIST_IPS
- _APP_CONSOLE_WHITELIST_CODES
- _APP_CONSOLE_GITHUB_APP_ID
- _APP_CONSOLE_GITHUB_SECRET
- _APP_SYSTEM_EMAIL_NAME