diff --git a/server/apps/admin.js b/server/apps/admin.js index f4259953..ac2c7aeb 100644 --- a/server/apps/admin.js +++ b/server/apps/admin.js @@ -155,7 +155,7 @@ app.post('/signup', passport.authenticate('local-signup', { app.post('/login', passport.authenticate('local-login', { successRedirect : '/', // redirect to the secure profile section - failureRedirect : '/login', // redirect back to the signup page if there is an error + failureRedirect : '/login#failed', // redirect back to the signup page if there is an error failureFlash : true // allow flash messages })); diff --git a/server/public/assets/admin/not_authenticated/js/main.js b/server/public/assets/admin/not_authenticated/js/main.js index ecc9bab2..a22b893a 100644 --- a/server/public/assets/admin/not_authenticated/js/main.js +++ b/server/public/assets/admin/not_authenticated/js/main.js @@ -8,6 +8,10 @@ $(document).ready(function(){ $("#login_form").prepend(""); $("#login_form").attr("action", "/signup"); } + if(window.location.hash == "#failed") { + window.location.hash = ""; + Materialize.toast("Couldn't find a user with that username or password..", 4000, "red lighten"); + } });