Skip to content

Commit

Permalink
Detect login errors. Thanks, mrjermey (http://tt-rss.org/forum/viewto…
Browse files Browse the repository at this point in the history
  • Loading branch information
g2ttrss committed Feb 2, 2014
1 parent 756ae2e commit 3c38f02
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions js/g2tt.js
Expand Up @@ -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
Expand Down

0 comments on commit 3c38f02

Please sign in to comment.