diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-05-12 17:18:56 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-05-12 17:18:56 -0400 |
commit | 5e32f55138ac1205279524ad98f98bc8411054eb (patch) | |
tree | 1af78357627c842d035b792f99dc7828cffcc544 /app/Api | |
parent | 3cf9484644dc5002b396eb31a2065456ce0de5b7 (diff) |
Add the possibility to pass API token as environment variable for Docker container
Diffstat (limited to 'app/Api')
-rw-r--r-- | app/Api/Middleware/AuthenticationMiddleware.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/Api/Middleware/AuthenticationMiddleware.php b/app/Api/Middleware/AuthenticationMiddleware.php index 174dc467..d2910589 100644 --- a/app/Api/Middleware/AuthenticationMiddleware.php +++ b/app/Api/Middleware/AuthenticationMiddleware.php @@ -78,6 +78,10 @@ class AuthenticationMiddleware extends Base implements MiddlewareInterface return API_AUTHENTICATION_TOKEN; } + if (getenv('API_AUTHENTICATION_TOKEN')) { + return getenv('API_AUTHENTICATION_TOKEN'); + } + return $this->configModel->get('api_token'); } } |