fix: authorize
This commit is contained in:
parent
b7d78c0af4
commit
c70c2ae8a1
4 changed files with 12 additions and 3 deletions
BIN
js/dist/forum.js
generated
vendored
BIN
js/dist/forum.js
generated
vendored
Binary file not shown.
BIN
js/dist/forum.js.map
generated
vendored
BIN
js/dist/forum.js.map
generated
vendored
Binary file not shown.
|
@ -206,7 +206,14 @@ export default class AuthorizePage extends IndexPage {
|
||||||
scope: this.params.scope,
|
scope: this.params.scope,
|
||||||
is_authorized: this.is_authorized,
|
is_authorized: this.is_authorized,
|
||||||
}
|
}
|
||||||
}).then((r) => console.log(r));
|
}).then((params) => {
|
||||||
|
let arr = []
|
||||||
|
for (let k in params) {
|
||||||
|
arr.push(`${k}=${params[k]}`)
|
||||||
|
}
|
||||||
|
let url = `${this.params.redirect_uri }?${arr.join('&')}`;
|
||||||
|
window.location.href = url;
|
||||||
|
});
|
||||||
|
|
||||||
// Some form handling logic here
|
// Some form handling logic here
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,8 +49,10 @@ class AuthorizeController implements RequestHandlerInterface
|
||||||
$server->handleAuthorizeRequest($request, $response, $is_authorized, $actor->id);
|
$server->handleAuthorizeRequest($request, $response, $is_authorized, $actor->id);
|
||||||
if ($is_authorized) {
|
if ($is_authorized) {
|
||||||
// this is only here so that you get to see your code in the cURL request. Otherwise, we'd redirect back to the client
|
// this is only here so that you get to see your code in the cURL request. Otherwise, we'd redirect back to the client
|
||||||
/* $code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=')+5, 40);
|
$code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=') + 5, 40);
|
||||||
exit("SUCCESS! Authorization Code: $code");*/
|
return new JsonResponse([
|
||||||
|
'code' => $code
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
$response->getResponseBody();
|
$response->getResponseBody();
|
||||||
return new JsonResponse(json_decode($response->getResponseBody(), true));
|
return new JsonResponse(json_decode($response->getResponseBody(), true));
|
||||||
|
|
Loading…
Reference in a new issue