forked from spacebar/SplatNet
Add log out support
This commit is contained in:
parent
82794e6f22
commit
ba0814eecd
9 changed files with 132 additions and 56 deletions
21
logout.js
Normal file
21
logout.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
$(document).ready(function () {
|
||||
const form = $("#logout-form");
|
||||
if (typeof CONFIG === 'undefined') {
|
||||
alert("CRITICAL ERROR: config.js not loaded before logout.js");
|
||||
return;
|
||||
}
|
||||
|
||||
const apiBase = CONFIG.API_BASE_URL;
|
||||
const targetAction = apiBase.replace(/\/$/, "") + "/spfn/logout";
|
||||
$("#logout_frontend_origin").val(window.location.origin);
|
||||
form.attr("action", targetAction);
|
||||
|
||||
console.log("Form action set to: " + targetAction);
|
||||
|
||||
form.submit(function(e) {
|
||||
alert("Submitting to: " + $(this).attr("action"));
|
||||
|
||||
const submitBtn = $(":submit", this);
|
||||
submitBtn.prop("disabled", true).css("opacity", "0.5");
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue