Class: OmniAuth::Strategies::Vis
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Vis
- Defined in:
- lib/omniauth/strategies/vis.rb
Instance Method Summary collapse
-
#callback_url ⇒ Object
to fix always getting invalid_grant error see github.com/omniauth/omniauth-oauth2/issues/81#issuecomment-231442739.
-
#on_path?(path) ⇒ Boolean
Fix strange bugs with urls containing double / like dhamma.org//oauth/callback.
- #raw_info ⇒ Object
- #setup_phase ⇒ Object
Instance Method Details
#callback_url ⇒ Object
to fix always getting invalid_grant error see github.com/omniauth/omniauth-oauth2/issues/81#issuecomment-231442739
40 41 42 |
# File 'lib/omniauth/strategies/vis.rb', line 40 def callback_url full_host + script_name + callback_path end |
#on_path?(path) ⇒ Boolean
Fix strange bugs with urls containing double / like dhamma.org//oauth/callback
34 35 36 |
# File 'lib/omniauth/strategies/vis.rb', line 34 def on_path?(path) current_path.squeeze('/').casecmp(path.squeeze('/')).zero? end |
#raw_info ⇒ Object
44 45 46 |
# File 'lib/omniauth/strategies/vis.rb', line 44 def raw_info @raw_info ||= access_token.get('/api/v1/me.json').parsed end |
#setup_phase ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/omniauth/strategies/vis.rb', line 17 def setup_phase # configure Oauth2 client_options.site from a custom server_url option ..site = .server_url # Authorize all params to be passed to VIS . = request.params.to_h end |