aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/api/ApiMiddleware.php
diff options
context:
space:
mode:
authorAurélien Tamisier <virtualtam+github@flibidi.net>2018-12-02 22:47:41 +0100
committerGitHub <noreply@github.com>2018-12-02 22:47:41 +0100
commit1004742f09b55ff781c13745781b9a7e90986faa (patch)
treeaa0e5743390296441edf09f44f95b3d21f2b5a16 /application/api/ApiMiddleware.php
parent5e0a898bb13fad528514b0d33763bcaae38b45b0 (diff)
parent9d9f6d75b94aab51067bdfbe50b58b66d1194f6d (diff)
downloadShaarli-1004742f09b55ff781c13745781b9a7e90986faa.tar.gz
Shaarli-1004742f09b55ff781c13745781b9a7e90986faa.tar.zst
Shaarli-1004742f09b55ff781c13745781b9a7e90986faa.zip
Merge pull request #1234 from virtualtam/lint
Setup PHPCS and cleanup linter configuration
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 }