Module: Sinatra::Security::Validations

Defined in:
lib/sinatra/security/validations.rb

Constant Summary collapse

EMAIL_FORMAT =
/\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i

Instance Method Summary collapse

Instance Method Details

#validateObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/sinatra/security/validations.rb', line 6

def validate
   = Sinatra::Security::LoginField.attr_name

  if  == :email
     :email
  else
    assert_present() and assert_unique()
  end

  assert_password :password
  
  super
end