diff --git a/public/src/forum/login.js b/public/src/forum/login.js index ff203625ab..6e83c0b9f2 100644 --- a/public/src/forum/login.js +++ b/public/src/forum/login.js @@ -11,4 +11,31 @@ document.location.href = target.getAttribute('data-url'); } }); + + + $('#login').on('click', function() { + + var loginData = { + 'username': $('#username').val(), + 'password': $('#password').val(), + '_csrf': $('#csrf-token').val() + }; + + $.ajax({ + type: "POST", + url: '/login', + data: loginData, + success: function(data, textStatus, jqXHR) { + $('#login-error-notify').hide(); + window.location.replace("/"); + }, + error : function(data, textStatus, jqXHR) { + $('#login-error-notify').show().delay(1000).fadeOut(250); + }, + dataType: 'json' + }); + + return false; + }); + }()); diff --git a/public/templates/login.tpl b/public/templates/login.tpl index 33b91ae51e..4cf156f7a6 100644 --- a/public/templates/login.tpl +++ b/public/templates/login.tpl @@ -6,13 +6,17 @@ Failed Login Attempt

-
+ +

- +   Forgot Password?
+ + Invalid username/password
+

Alternative Logins