aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/api/ApiMiddleware.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-11-10 10:46:04 +0100
committerGitHub <noreply@github.com>2020-11-10 10:46:04 +0100
commit302662797cb5e8ac6579a99297ceae301f7927a6 (patch)
tree67f493a1cc6d3691742946f1d7e512bffe41e02f /application/api/ApiMiddleware.php
parentc94c32d1a3e86a479cb2582eadc668a5bb476fc6 (diff)
parent2f4df753041088d788d1923692a7d530167a6840 (diff)
downloadShaarli-302662797cb5e8ac6579a99297ceae301f7927a6.tar.gz
Shaarli-302662797cb5e8ac6579a99297ceae301f7927a6.tar.zst
Shaarli-302662797cb5e8ac6579a99297ceae301f7927a6.zip
Merge pull request #1635 from ArthurHoaro/feature/phpcs
Diffstat (limited to 'application/api/ApiMiddleware.php')
-rw-r--r--application/api/ApiMiddleware.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/application/api/ApiMiddleware.php b/application/api/ApiMiddleware.php
index adc8b266..9fb88358 100644
--- a/application/api/ApiMiddleware.php
+++ b/application/api/ApiMiddleware.php
@@ -1,4 +1,5 @@
1<?php 1<?php
2
2namespace Shaarli\Api; 3namespace Shaarli\Api;
3 4
4use malkusch\lock\mutex\FlockMutex; 5use malkusch\lock\mutex\FlockMutex;
@@ -108,7 +109,8 @@ class ApiMiddleware
108 */ 109 */
109 protected function checkToken($request) 110 protected function checkToken($request)
110 { 111 {
111 if (!$request->hasHeader('Authorization') 112 if (
113 !$request->hasHeader('Authorization')
112 && !isset($this->container->environment['REDIRECT_HTTP_AUTHORIZATION']) 114 && !isset($this->container->environment['REDIRECT_HTTP_AUTHORIZATION'])
113 ) { 115 ) {
114 throw new ApiAuthorizationException('JWT token not provided'); 116 throw new ApiAuthorizationException('JWT token not provided');