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
#validate ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/sinatra/security/validations.rb', line 6 def validate login_field = Sinatra::Security::LoginField.attr_name if login_field == :email assert_login_using_email :email else assert_present(login_field) and assert_unique(login_field) end assert_password :password super end |