summaryrefslogtreecommitdiffstats
path: root/dist/js/login.js
diff options
context:
space:
mode:
authorAnton Luka Šijanec <sijanecantonluka@gmail.com>2020-06-04 16:31:04 +0200
committerGitHub <noreply@github.com>2020-06-04 16:31:04 +0200
commitf3a11185852127f70599295fdc5c7e9b72d790b6 (patch)
tree5e0f9eb2e0e41e6ff40f17ada1f508557ef3ab63 /dist/js/login.js
parentMerge pull request #21 from beziapp/github-actions-fix (diff)
parentslovnična napaka == crirical bug (diff)
downloadbeziapp-f3a11185852127f70599295fdc5c7e9b72d790b6.tar
beziapp-f3a11185852127f70599295fdc5c7e9b72d790b6.tar.gz
beziapp-f3a11185852127f70599295fdc5c7e9b72d790b6.tar.bz2
beziapp-f3a11185852127f70599295fdc5c7e9b72d790b6.tar.lz
beziapp-f3a11185852127f70599295fdc5c7e9b72d790b6.tar.xz
beziapp-f3a11185852127f70599295fdc5c7e9b72d790b6.tar.zst
beziapp-f3a11185852127f70599295fdc5c7e9b72d790b6.zip
Diffstat (limited to '')
-rw-r--r--dist/js/login.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/dist/js/login.js b/dist/js/login.js
index 88cf081..2d79576 100644
--- a/dist/js/login.js
+++ b/dist/js/login.js
@@ -2,4 +2,4 @@
document.addEventListener("DOMContentLoaded",()=>{setupEventListeners();})
function setupEventListeners(){$("#login-button").click(()=>{login();});window.addEventListener("keyup",(event)=>{if(event.keyCode===13){event.preventDefault();login();}});}
function login(){let username=$("#username").val();let password=$("#password").val();var gsecInstance;try{gsecInstance=new gsec();}catch(error){$.ajax({url:'js/gsec.js?ajaxload',async:false,dataType:"script",});try{gsecInstance=new gsec();}catch(error){alert(D("browserNotSupported"));}}
-gsecInstance.login(username,password).then((value)=>{if(typeof value=="string"){let promises_to_run=[localforage.setItem("logged_in",true),localforage.setItem("username",username),localforage.setItem("password",password)];Promise.all(promises_to_run).then(function(){window.location.replace("/pages/timetable.html");});}else{UIAlert("loginFailed");$("#password").val("");}}).catch((err)=>{gsecErrorHandlerUI(err);$("#password").val("");});} \ No newline at end of file
+gsecInstance.login(username,password).then((value)=>{if(typeof value=="string"){let promises_to_run=[localforage.setItem("logged_in",true),localforage.setItem("username",username),localforage.setItem("password",password)];read_val(0);Promise.all(promises_to_run).then(function(){window.location.replace("/pages/timetable.html");});}else{UIAlert("loginFailed");$("#password").val("");}}).catch((err)=>{gsecErrorHandlerUI(err);$("#password").val("");});} \ No newline at end of file