Commit ba30cd10469e84865279cfb18e6f69a8c1c382f7
1 parent
366359fc
Exists in
master
and in
5 other branches
improved login message
Showing
1 changed file
with
9 additions
and
5 deletions
Show diff stats
js/main.js
... | ... | @@ -23,9 +23,9 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
23 | 23 | var participa = true; |
24 | 24 | |
25 | 25 | //Detects for localhost settings |
26 | - var patt = new RegExp(":3000/"); | |
27 | - //if(patt.test(window.location.href)) | |
28 | - // participa = false; | |
26 | + var patt = new RegExp(":3001/"); | |
27 | + if(patt.test(window.location.href)) | |
28 | + participa = false; | |
29 | 29 | |
30 | 30 | if(participa){ |
31 | 31 | var host = 'http://www.participa.br'; |
... | ... | @@ -808,9 +808,13 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
808 | 808 | }).done(function(data) { |
809 | 809 | Main.loginCallback(true, data.private_token); |
810 | 810 | Main.displaySuccess(button.closest('.section-content'), 'Login efetuado com sucesso', 1000); |
811 | - }).fail(function( /*data*/ ) { | |
811 | + }).fail(function(data) { | |
812 | 812 | message.show(); |
813 | - message.text('Não foi possível logar'); | |
813 | + if(data.status==401){ | |
814 | + message.text('Nome de usuário, e-mail ou senha incorretos, não foi possível acessar.'); | |
815 | + }else{ | |
816 | + message.text('Um erro inesperado ocorreu'); | |
817 | + } | |
814 | 818 | }); |
815 | 819 | e.preventDefault(); |
816 | 820 | }); | ... | ... |