OpenAuth_server/views/src/authorize/authorize.js

16 lines
460 B
JavaScript

document.getElementById("hidden_form").action += window.location.href.split("?")[1];
function submit() {
document.getElementById("hidden_form").submit();
}
document.getElementById("cancel").onclick = () => {
let u = new URL(window.location);
let uri = u.searchParams.get("redirect_uri");
window.location.href = uri + "?error=access_denied&state=" + u.searchParams.get("state");
}
document.getElementById("allow").onclick = () => {
submit()
}