fix: oauth
This commit is contained in:
parent
f76763496a
commit
19a17bc851
2 changed files with 6 additions and 5 deletions
|
@ -35,14 +35,14 @@ class AuthorizeController implements RequestHandlerInterface
|
|||
|
||||
$params = $request->getParsedBody();
|
||||
|
||||
$oauth = new OAuth();
|
||||
$oauth = new OAuth($this->settings);
|
||||
$server = $oauth->server();
|
||||
$request = $oauth->request()::createFromGlobals();
|
||||
$response = $oauth->response();
|
||||
|
||||
if (!$server->validateAuthorizeRequest($request, $response)) {
|
||||
$response->send();
|
||||
die;
|
||||
$response->getResponseBody();
|
||||
return new JsonResponse(json_decode($response->getResponseBody(), true));
|
||||
}
|
||||
|
||||
$is_authorized = (Arr::get($params, 'authorized', 'no') === 'yes');
|
||||
|
@ -52,6 +52,7 @@ class AuthorizeController implements RequestHandlerInterface
|
|||
/* $code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=')+5, 40);
|
||||
exit("SUCCESS! Authorization Code: $code");*/
|
||||
}
|
||||
$response->send();
|
||||
$response->getResponseBody();
|
||||
return new JsonResponse(json_decode($response->getResponseBody(), true));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -433,7 +433,7 @@ class Storage implements
|
|||
if ($result = Models\Scope::where('is_default', true)->get()) {
|
||||
$defaultScope = array_map(function ($row) {
|
||||
return $row['scope'];
|
||||
}, $result);
|
||||
}, $result->toArray());
|
||||
|
||||
return implode(' ', $defaultScope);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue