From 5e32f55138ac1205279524ad98f98bc8411054eb Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Fri, 12 May 2017 17:18:56 -0400 Subject: Add the possibility to pass API token as environment variable for Docker container --- app/Api/Middleware/AuthenticationMiddleware.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/Api') 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'); } } -- cgit v1.2.3