aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/api/ApiMiddleware.php
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2019-02-23 16:27:33 +0100
committerVirtualTam <virtualtam@flibidi.net>2019-02-23 16:27:33 +0100
commit43c77f658a905e2def6aeca4c092683977cd0c55 (patch)
treecb0dc273a315a777847d251f856625b2fc779c04 /application/api/ApiMiddleware.php
parent630ebca2b6359e942e5b6c057cca2b6069c1093a (diff)
parent1826e383ecf501302974132fd443cf1ca06e10f6 (diff)
downloadShaarli-43c77f658a905e2def6aeca4c092683977cd0c55.tar.gz
Shaarli-43c77f658a905e2def6aeca4c092683977cd0c55.tar.zst
Shaarli-43c77f658a905e2def6aeca4c092683977cd0c55.zip
Merge commit '1826e383ecf501302974132fd443cf1ca06e10f6' into v0.10
Diffstat (limited to 'application/api/ApiMiddleware.php')
-rw-r--r--application/api/ApiMiddleware.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/application/api/ApiMiddleware.php b/application/api/ApiMiddleware.php
index ff209393..66eac133 100644
--- a/application/api/ApiMiddleware.php
+++ b/application/api/ApiMiddleware.php
@@ -65,7 +65,7 @@ class ApiMiddleware
65 try { 65 try {
66 $this->checkRequest($request); 66 $this->checkRequest($request);
67 $response = $next($request, $response); 67 $response = $next($request, $response);
68 } catch(ApiException $e) { 68 } catch (ApiException $e) {
69 $e->setResponse($response); 69 $e->setResponse($response);
70 $e->setDebug($this->conf->get('dev.debug', false)); 70 $e->setDebug($this->conf->get('dev.debug', false));
71 $response = $e->getApiResponse(); 71 $response = $e->getApiResponse();
@@ -98,7 +98,8 @@ class ApiMiddleware
98 * 98 *
99 * @throws ApiAuthorizationException The token couldn't be validated. 99 * @throws ApiAuthorizationException The token couldn't be validated.
100 */ 100 */
101 protected function checkToken($request) { 101 protected function checkToken($request)
102 {
102 if (! $request->hasHeader('Authorization')) { 103 if (! $request->hasHeader('Authorization')) {
103 throw new ApiAuthorizationException('JWT token not provided'); 104 throw new ApiAuthorizationException('JWT token not provided');
104 } 105 }