getHeaderLine('Authorization'); if (empty($authorization)) { return $this->response->json(['code' => 401, 'JWT voucher cannot be empty.']); } if (!str_starts_with($authorization, 'Bearer ')) { return $this->response->json(['code' => 401, 'JWT Voucher Format Error.']); } $authorization = str_replace('Bearer ', '', $authorization); $jwt = Kiri::app()->getJwt(); if (!$jwt->validator($authorization)) { return $this->response->json(['code' => 401, 'JWT Validator fail.']); } return $handler->handle($request); } }