header('Authorization'); if (empty($authorization)) { throw new JWTAuthTokenException('JWT voucher cannot be empty.'); } if (!str_starts_with($authorization, 'Bearer ')) { throw new JWTAuthTokenException('JWT Voucher Format Error.'); } $authorization = str_replace('Bearer ', '', $authorization); $jwt = Kiri::app()->getJwt(); if (!$jwt->validator($authorization)) { throw new JWTAuthTokenException('JWT Validator fail.'); } return $next($request); } }