Class: OmniAuth::Strategies::BnLauncher
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::BnLauncher
- Defined in:
- lib/omniauth/strategies/bn_launcher.rb,
lib/omniauth/strategies/launcher/validation_error.rb
Defined Under Namespace
Classes: ValidationError
Instance Method Summary collapse
- #callback_phase ⇒ Object
- #callback_url ⇒ Object
- #raw_info ⇒ Object
- #redirect_url ⇒ Object
- #request_phase ⇒ Object
Instance Method Details
#callback_phase ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/omniauth/strategies/bn_launcher.rb', line 40 def callback_phase if request.base_url == [:default_callback_url] response = Rack::Response.new response.redirect redirect_url response.finish elsif !request.params["message"].nil? fail!(request.params["message"]) else super end end |
#callback_url ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/omniauth/strategies/bn_launcher.rb', line 18 def callback_url if [:default_callback_url].nil? fail!(:callback_url_not_set) end [:default_callback_url] + script_name + callback_path + query_string rescue => e fail!(e.) end |
#raw_info ⇒ Object
76 77 78 |
# File 'lib/omniauth/strategies/bn_launcher.rb', line 76 def raw_info @raw_info ||= access_token.get("/user").parsed end |
#redirect_url ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/omniauth/strategies/bn_launcher.rb', line 27 def redirect_url # Should remove the gl_redirect_url has that is used for the old launcher if !request.params["customer"].nil? customer_redirect_url = "#{request.scheme}://#{request.params["customer"]}.#{request.host}:#{request.port}" customer_redirect_url + script_name + callback_path + query_string else #should be changed to customer once the old launcher is removed fail!(:customer_not_set) end rescue => e fail!(e.) end |
#request_phase ⇒ Object
13 14 15 16 |
# File 'lib/omniauth/strategies/bn_launcher.rb', line 13 def request_phase .[:customer] = [:customer] super end |