aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/api/ApiMiddleware.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2019-07-27 12:34:30 +0200
committerArthurHoaro <arthur@hoa.ro>2019-07-27 12:34:30 +0200
commit38672ba0d1c722e5d6d33a58255ceb55e9410e46 (patch)
treedae4c7c47532380eac3ae641db99122fc77c93dc /application/api/ApiMiddleware.php
parent83faedadff76c5bdca036f39f13943f63b27e164 (diff)
parent1e77e0448bbd25675d8c0fe4a73206ad9048904b (diff)
downloadShaarli-38672ba0d1c722e5d6d33a58255ceb55e9410e46.tar.gz
Shaarli-38672ba0d1c722e5d6d33a58255ceb55e9410e46.tar.zst
Shaarli-38672ba0d1c722e5d6d33a58255ceb55e9410e46.zip
Merge tag 'v0.10.4' into stable
Release v0.10.4
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 }