OpenAuth_server/views/src/authorize/authorize.js

22 lines
527 B
JavaScript
Raw Normal View History

2020-08-07 14:16:39 +00:00
document.getElementById("hidden_form").action += window.location.href.split(
"?"
)[1];
2018-11-06 19:48:50 +00:00
function submit() {
document.getElementById("hidden_form").submit();
}
document.getElementById("cancel").onclick = () => {
let u = new URL(window.location);
let uri = u.searchParams.get("redirect_uri");
if (uri === "$local") {
uri = "/code";
}
2020-08-07 14:16:39 +00:00
window.location.href =
uri + "?error=access_denied&state=" + u.searchParams.get("state");
};
2018-11-06 19:48:50 +00:00
document.getElementById("allow").onclick = () => {
2020-08-07 14:16:39 +00:00
submit();
};