Module: Platforms::Core::OAuth2
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/platforms/core/o_auth_2.rb
Overview
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.
21 22 23 24 |
# File 'lib/platforms/core/o_auth_2.rb', line 21 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.
12 13 14 |
# File 'lib/platforms/core/o_auth_2.rb', line 12 def token request.env["omniauth.auth"].credentials.token end |