From 683c373943a4e331af89276c032861e0d2501206 Mon Sep 17 00:00:00 2001 From: lilia Date: Fri, 10 Oct 2014 16:32:22 -0700 Subject: [PATCH] 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. --- js/options.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/options.js b/js/options.js index 456b68a7041d..90278b5e7d89 100644 --- a/js/options.js +++ b/js/options.js @@ -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() {