Commit 13f485f7c42635325cf8f2b5b4952f1d3af0dd45
1 parent
3dc76006
Exists in
master
and in
5 other branches
disable password validations on OAUTH signup
Showing
1 changed file
with
13 additions
and
8 deletions
Show diff stats
js/main.js
| @@ -1304,6 +1304,7 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | @@ -1304,6 +1304,7 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | ||
| 1304 | 1304 | ||
| 1305 | $(document).on('click', '.cancel-signup', function(e) { | 1305 | $(document).on('click', '.cancel-signup', function(e) { |
| 1306 | var signupForm = $(this).parents('#signup-form'); | 1306 | var signupForm = $(this).parents('#signup-form'); |
| 1307 | + signupForm.find('#user_oauth_providers').val(''); | ||
| 1307 | signupForm.hide(); | 1308 | signupForm.hide(); |
| 1308 | signupForm.siblings('#login-form').show(); | 1309 | signupForm.siblings('#login-form').show(); |
| 1309 | e.preventDefault(); | 1310 | e.preventDefault(); |
| @@ -1342,6 +1343,8 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | @@ -1342,6 +1343,8 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | ||
| 1342 | 1343 | ||
| 1343 | var messageErrors = []; | 1344 | var messageErrors = []; |
| 1344 | 1345 | ||
| 1346 | + var isOAUTH = $signupForm.find('#user_oauth_providers').val() !== ''; | ||
| 1347 | + | ||
| 1345 | messageErrors.push('<ul>'); // start a HTML list | 1348 | messageErrors.push('<ul>'); // start a HTML list |
| 1346 | 1349 | ||
| 1347 | if (!hasEmail){ | 1350 | if (!hasEmail){ |
| @@ -1352,16 +1355,18 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | @@ -1352,16 +1355,18 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | ||
| 1352 | messageErrors.push('<li>O nome de usuário é um campo obrigatório.</li>'); | 1355 | messageErrors.push('<li>O nome de usuário é um campo obrigatório.</li>'); |
| 1353 | } | 1356 | } |
| 1354 | 1357 | ||
| 1355 | - if (!hasPassword){ | ||
| 1356 | - messageErrors.push('<li>A senha é um campo obrigatório.</li>'); | ||
| 1357 | - } | 1358 | + if(!isOAUTH){ |
| 1359 | + if (!hasPassword){ | ||
| 1360 | + messageErrors.push('<li>A senha é um campo obrigatório.</li>'); | ||
| 1361 | + } | ||
| 1358 | 1362 | ||
| 1359 | - if (!hasPasswordConfirmation){ | ||
| 1360 | - messageErrors.push('<li>A confirmação da senha é um campo obrigatório.</li>'); | ||
| 1361 | - } | 1363 | + if (!hasPasswordConfirmation){ |
| 1364 | + messageErrors.push('<li>A confirmação da senha é um campo obrigatório.</li>'); | ||
| 1365 | + } | ||
| 1362 | 1366 | ||
| 1363 | - if (!hasPasswordEquals){ | ||
| 1364 | - messageErrors.push('<li>A senha e confirmação da senha devem ser iguais.</li>'); | 1367 | + if (!hasPasswordEquals){ |
| 1368 | + messageErrors.push('<li>A senha e confirmação da senha devem ser iguais.</li>'); | ||
| 1369 | + } | ||
| 1365 | } | 1370 | } |
| 1366 | 1371 | ||
| 1367 | if (!hasAcceptation){ | 1372 | if (!hasAcceptation){ |