Class: OmniAuth::Strategies::Cafepress
- Inherits:
-
Object
- Object
- OmniAuth::Strategies::Cafepress
- Includes:
- OmniAuth::Strategy
- Defined in:
- lib/omniauth/strategies/cafepress.rb
Instance Method Summary collapse
Instance Method Details
#raw_info ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/omniauth/strategies/cafepress.rb', line 42 def raw_info @raw_info ||= MultiXml.parse(Faraday.get("#{[:token_url]}?v=3&appKey=#{[:app_key]}&email=#{request.params['email']}&password=#{request.params['password']}").body) rescue ::MultiXml::ParseError => e fail!(:xml_error, e) rescue ::Faraday::Error::TimeoutError => e fail!(:timeout, e) rescue Exception fail! :general_exception end |
#request_phase ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/omniauth/strategies/cafepress.rb', line 15 def request_phase form = OmniAuth::Form.new(title: "User Info", url: callback_path) .fields.each do |field| form.text_field field.to_s.capitalize.gsub("_", " "), field.to_s end form. "Sign In" form.to_response end |