bshaffer / oauth2-server-php

A library for implementing an OAuth2 Server in php
http://bshaffer.github.io/oauth2-server-php-docs
MIT License
3.26k stars 950 forks source link

cors issue with authorize.php #1050

Closed karimcambridge closed 1 year ago

karimcambridge commented 1 year ago

When using for e.g, nextjs development we can't query authorize.php and i'm not exactly sure how to add headers in this file.

Issue is this piece of code

// include our OAuth2 Server object
require_once __DIR__ . '/server.php';

$request = OAuth2\Request::createFromGlobals();
$response = new OAuth2\Response();

// validate the authorize request
if (!$server->validateAuthorizeRequest($request, $response)) {
    $response->send();
    die;
}