Class: OmniAuth::Strategies::Password
- Inherits:
-
Object
- Object
- OmniAuth::Strategies::Password
- Includes:
- OmniAuth::Strategy
- Defined in:
- lib/aerogel/users/omniauth-password.rb
Constant Summary collapse
- PROVIDER_NAME =
:password
Instance Method Summary collapse
-
#callback_phase ⇒ Object
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.
Instance Method Details
#callback_phase ⇒ Object
def request_phase
form = OmniAuth::Form.new(:title => "User Info", :url => callback_path)
[ .username_field, .password_field ].each do |field|
form.text_field field.to_s.capitalize.gsub("_", " "), field.to_s
end
form. "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, &.on_authenticate ) return fail!(:invalid_credentials) end super end |