From 19714d01e28ca9ba37564fe0ad48d81c665806dd Mon Sep 17 00:00:00 2001 From: Thais Siqueira Date: Fri, 10 Mar 2017 12:02:56 -0300 Subject: Validates recovery code as hexadecimal data. Related with https://github.com/pixelated/pixelated-user-agent/issues/924 With @aarni --- app/models/user.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/models/user.rb b/app/models/user.rb index 215a3b0..f8869cd 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -35,8 +35,8 @@ class User < CouchRest::Model::Base validate :identity_is_valid - validates :password_salt, :password_verifier, - :format => { :with => /\A[\dA-Fa-f]+\z/, :message => "Only hex numbers allowed" } + validates :password_salt, :password_verifier, :recovery_code_verifier, :recovery_code_salt, + :format => { :with => /\A[\h]*\z/, :message => "Only hex numbers allowed" } validates :password, :presence => true, :confirmation => true, -- cgit v1.2.3