mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-17 01:15:42 +01:00
Add multi-region launcher support
Add custom launcher as well as support for both the original TW and JP launchers.
This commit is contained in:
38
www/erupe/js/login.js
Normal file
38
www/erupe/js/login.js
Normal file
@@ -0,0 +1,38 @@
|
||||
function createErrorAlert(message) {
|
||||
parent.postMessage(message, "*");
|
||||
}
|
||||
|
||||
|
||||
// Function to continually check if we got a login result yet,
|
||||
// then navigating to the character selection if we did.
|
||||
function checkAuthResult() {
|
||||
var loginResult = window.external.getLastAuthResult();
|
||||
console.log('|' + loginResult + '|');
|
||||
if(loginResult == "AUTH_PROGRESS") {
|
||||
setTimeout(checkAuthResult, 1500);
|
||||
} else if (loginResult == "AUTH_SUCCESS") {
|
||||
window.location.href = 'charsel.html'
|
||||
} else {
|
||||
createErrorAlert("Error logging in!");
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
|
||||
// Login form submission.
|
||||
$("#loginform").submit(function(e){
|
||||
e.preventDefault();
|
||||
|
||||
username = $("#username").val();
|
||||
password = $("#password").val();
|
||||
|
||||
try{
|
||||
window.external.loginCog(username, password, password);
|
||||
} catch(e){
|
||||
createErrorAlert("Error on loginCog: " + e);
|
||||
}
|
||||
|
||||
checkAuthResult();
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user