From 9a7f36083f83b371548dc7c0eb2081aa829a817e Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Sat, 18 Jul 2015 11:09:19 +0200 Subject: [PATCH] Prevent empty passwords in room conf --- public/js/vroom.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/js/vroom.js b/public/js/vroom.js index f5eba44..35d666d 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -327,12 +327,20 @@ $('#configureRoomForm').submit(function(e){ $('#joinPassConfirm').notify(localize('PASSWORDS_DO_NOT_MATCH'), 'error'); return false; } + if ($('#joinPassFields').css('display') !== 'none' && $('#joinPass').val() === ''){ + $('#joinPass').notify(localize('PASSWORDS_CANNOT_BE_EMPTY'), 'error'); + return false; + } } if ($('#ownerPassSet').bootstrapSwitch('state')){ if ($('#ownerPass').val() !== $('#ownerPassConfirm').val()){ $('#ownerPassConfirm').notify(localize('PASSWORDS_DO_NOT_MATCH'), 'error'); return false; } + if ($('#ownerPassFields').css('display') !== 'none' && $('#ownerPass').val() === ''){ + $('#ownerPass').notify(localize('PASSWORDS_CANNOT_BE_EMPTY'), 'error'); + return false; + } } var validEmail = true; $('.email-list').find('input').each(function(index, input){