Fix missing env
This commit is contained in:
parent
0f36245f78
commit
55deaec8b2
2 changed files with 6 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue