Class: Tramway::Auth::SessionForm

Inherits:
Core::ApplicationForm
  • Object
show all
Defined in:
app/forms/tramway/auth/session_form.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



6
7
8
# File 'app/forms/tramway/auth/session_form.rb', line 6

def password
  @password
end

Instance Method Details

#validate(params) ⇒ Object



8
9
10
11
12
# File 'app/forms/tramway/auth/session_form.rb', line 8

def validate(params)
  (!model.new_record? && model.authenticate(params[:password])).tap do |result|
    add_wrong_email_or_password_error unless result
  end
end