Module: Platforms::Core::OAuth2
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/platforms/core/o_auth_2.rb
Overview
TODO:
extract out the common functionality.
This is a module for common authentication methods, across multiple platforms.
Instance Method Summary collapse
-
#bool_safe(val) ⇒ Object
Sometimes the return value is a string “true”, while others it is cast as a boolean.
-
#token ⇒ Object
Get the token from the OmniAuth credentials store A convenience method.
Instance Method Details
#bool_safe(val) ⇒ Object
Sometimes the return value is a string “true”, while others it is cast as a boolean. This normalises that behaviour to true or false. Any non-“true” String value should return false.
22 23 24 25 |
# File 'lib/platforms/core/o_auth_2.rb', line 22 def bool_safe val return val == "true" if val.is_a? String val.eql?(true) end |
#token ⇒ Object
Get the token from the OmniAuth credentials store A convenience method.
13 14 15 |
# File 'lib/platforms/core/o_auth_2.rb', line 13 def token request.env["omniauth.auth"].credentials.token end |