diff --git a/js/g2tt.js b/js/g2tt.js index 3c58fe4..626d9bf 100644 --- a/js/g2tt.js +++ b/js/g2tt.js @@ -55,12 +55,20 @@ $(document).ready(function () { request.done(function (response, textStatus, jqXHR) { console.log(response['content']); - $.cookie('g2tt_sid', response['content'].session_id, { - expires: 7 - }); - $('.login').addClass('hidden'); - $('#main').removeClass('hidden'); - load(); + if (response['content'].error =='LOGIN_ERROR'){ + window.alert("Username and/or Password were incorrect!"); + } + if (response['content'].error =='API_DISABLED'){ + window.alert("The API Setting is disabled. Login on the desktop version and enable API in the Preferences."); + } + else { + $.cookie('g2tt_sid', response['content'].session_id, { + expires: 7 + }); + $('.login').addClass('hidden'); + $('#main').removeClass('hidden'); + load(); + } }); // callback handler that will be called on failure