Relaxes verification code validation

When codes are sent they are formatted as xxx-xxx. Previously when I
would paste these from GVoice they failed validation thanks to the dash
and whatever whitespace I happened to grab.
This commit is contained in:
lilia 2014-10-10 16:32:22 -07:00
parent 27708cd8d7
commit 683c373943

View file

@ -28,8 +28,8 @@ function updateNumberColors() {
}
function isCodeValid() {
var code = $('#code');
return code.val().replace(/\D/g, '') == code.val() && code.val().length == 6;
var verificationCode = $('#code').val().replace(/\D/g, '');
return verificationCode.length == 6;
}
$('#code').on('change', function() {