Class: OmniAuth::Strategies::Password

Inherits:
Object
  • Object
show all
Includes:
OmniAuth::Strategy
Defined in:
lib/aerogel/users/omniauth-password.rb

Constant Summary collapse

PROVIDER_NAME =
:password

Instance Method Summary collapse

Instance Method Details

#callback_phaseObject

def request_phase

form = OmniAuth::Form.new(:title => "User Info", :url => callback_path)
[ options.username_field, options.password_field ].each do |field|
  form.text_field field.to_s.capitalize.gsub("_", " "), field.to_s
end
form.button "Sign In"
form.to_response

end



34
35
36
37
38
39
40
41
42
# File 'lib/aerogel/users/omniauth-password.rb', line 34

def callback_phase
  request.params['uid'] = uid
  request.env['omniauth.origin'] ||= request.params['origin']
  request.env['omniauth.params'] = request.params
  unless instance_exec( request.params, &options.on_authenticate )
    return fail!(:invalid_credentials)
  end
  super
end