From a4e25ed95b896f39aadec6123543dae1bc80e8fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Sat, 21 Mar 2020 00:58:21 +0100 Subject: teachers.js, absences.js: uporabljajo gsec.js; gsec.js: spremembe apija --- js/app.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'js/app.js') diff --git a/js/app.js b/js/app.js index f5e9d50..f7c423f 100644 --- a/js/app.js +++ b/js/app.js @@ -24,3 +24,16 @@ async function UIAlert(usermsg, devmsg) { } } +function gsecErrorHandlerUI(err) { + console.log("gsecErrorHanderUI: handling "+err); + if(err == GSEC_ERR_NET || err == GSEC_ERR_NET_POSTBACK_GET || err == GSEC_ERR_NET_POSTBACK_POST) { + UIAlert( D("gsecErrNet") ); + } else if(err == GSEC_ERR_LOGIN) { + UIAlert( D("gsecErrLogin") ); + localforage.setItem("logged_in", false).then( () => { + window.location.replace("/index.html"); + }); + } else { + UIAlert( D("gsecErrOther") ); + } +} -- cgit v1.2.3