Commit 82ea0d6c authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Small fix

parent 40824ca8
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -130,18 +130,18 @@ Flight::route('POST /auth/oauth2/check_token', function() {
    $headers = apache_request_headers();
    $headers = apache_request_headers();


    if (!isset($headers['Authorization'])) {
    if (!isset($headers['Authorization'])) {
        throw new BadRequestException("Missing Authorization header");
        throw new \RAP\BadRequestException("Missing Authorization header");
    }
    }


    $authorizationHeader = explode(" ", $headers['Authorization']);
    $authorizationHeader = explode(" ", $headers['Authorization']);
    if ($authorizationHeader[0] === "Bearer") {
    if ($authorizationHeader[0] === "Bearer") {
        $token = $authorizationHeader[1];
        $token = $authorizationHeader[1];
    } else {
    } else {
        throw new BadRequestException("Invalid token type");
        throw new \RAP\BadRequestException("Invalid token type");
    }
    }


    if ($token === null) {
    if ($token === null) {
        throw new BadRequestException("Access token is required");
        throw new \RAP\BadRequestException("Access token is required");
    }
    }


    $requestHandler = new \RAP\OAuth2RequestHandler($locator);
    $requestHandler = new \RAP\OAuth2RequestHandler($locator);