fix: location after authorized
This commit is contained in:
parent
2a7948fffd
commit
803d7404b9
4 changed files with 4 additions and 9 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.
|
@ -43,7 +43,7 @@ export default class AuthorizePage extends IndexPage {
|
||||||
if (app.forum.attribute('foskym-oauth-center.require_exact_redirect_uri') && uris.indexOf(params.redirect_uri) == -1) {
|
if (app.forum.attribute('foskym-oauth-center.require_exact_redirect_uri') && uris.indexOf(params.redirect_uri) == -1) {
|
||||||
m.route.set('/');
|
m.route.set('/');
|
||||||
}
|
}
|
||||||
if (app.forum.attribute('foskym-oauth-center.allow_implicit') && params.response_type == 'token') {
|
if (!app.forum.attribute('foskym-oauth-center.allow_implicit') && params.response_type == 'token') {
|
||||||
m.route.set('/');
|
m.route.set('/');
|
||||||
}
|
}
|
||||||
if (app.forum.attribute('foskym-oauth-center.enforce_state') && params.enforce_state == null) {
|
if (app.forum.attribute('foskym-oauth-center.enforce_state') && params.enforce_state == null) {
|
||||||
|
@ -214,12 +214,7 @@ export default class AuthorizePage extends IndexPage {
|
||||||
is_authorized: this.is_authorized,
|
is_authorized: this.is_authorized,
|
||||||
}
|
}
|
||||||
}).then((params) => {
|
}).then((params) => {
|
||||||
let arr = []
|
window.location.href = params.location;
|
||||||
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
|
||||||
|
|
|
@ -47,9 +47,9 @@ class AuthorizeController implements RequestHandlerInterface
|
||||||
$is_authorized = Arr::get($params, 'is_authorized', 0);
|
$is_authorized = Arr::get($params, 'is_authorized', 0);
|
||||||
$server->handleAuthorizeRequest($request, $response, $is_authorized, $actor->id);
|
$server->handleAuthorizeRequest($request, $response, $is_authorized, $actor->id);
|
||||||
if ($is_authorized) {
|
if ($is_authorized) {
|
||||||
$code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=') + 5, 40);
|
// $code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=') + 5, 40);
|
||||||
return new JsonResponse([
|
return new JsonResponse([
|
||||||
'code' => $code
|
'location' => $response->getHttpHeader('Location')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue