summaryrefslogtreecommitdiff
path: root/js/codeq
diff options
context:
space:
mode:
Diffstat (limited to 'js/codeq')
-rw-r--r--js/codeq/login.js14
1 files changed, 6 insertions, 8 deletions
diff --git a/js/codeq/login.js b/js/codeq/login.js
index 79371be..5f6aa4c 100644
--- a/js/codeq/login.js
+++ b/js/codeq/login.js
@@ -28,12 +28,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
jqSignupBtn = $('#signup_button'),
jqSubmitLoginBtn = $("#submit"),
jqLangSelect = jqScreen.find('.lang-select'),
- jqDisabledOverlay = $('#disabled');
+ jqDisabledOverlay = $('#disabled'),
+ jqLoginFailed = jqScreen.find('.login-failed');
//the loginCallbackFunction is used here and in the AAI login as well
codeq.loginCallbackFunction = function (data) {
jqDisabledOverlay.css('display', 'none');
- jqDisabledOverlay.css('cursor', '');
if (data.code !== 0) throw new Error('Login failed, code: ' + data.code + ', message: ' + data.message);
//nav signed in...
@@ -62,18 +62,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
};
var loginFun = function(){
- jqDisabledOverlay.css('display', '');
- jqDisabledOverlay.css('cursor', 'wait');
+ jqLoginFailed.hide();
codeq.comms.connect()
.then(function () {
return codeq.comms.login($('#username').val(), $('#password').val());
})
.then(codeq.loginCallbackFunction)
.fail(function (reason) {
- jqDisabledOverlay.css('display', 'none');
- jqDisabledOverlay.css('cursor', '');
- codeq.log.error('Login failed: ' + reason);
- alert('Login request failed: ' + reason);
+ jqLoginFailed.show();
})
.done();
},
@@ -85,6 +81,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
'enter': function(){
jqNavigationHomeBtn.off('click');//remove the click listener of this element here
jqNavBarRight.css('display','none');//hide settings etc.
+ jqLoginFailed.hide();
$('#signed-in-title').html('');
codeq.samlLogin = false;//remove saml login flag
@@ -132,6 +129,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
e.preventDefault();
});
jqNavBarRight.css('display','');
+ jqLoginFailed.hide();
}
});
})();