Class: OmniAuth::Strategies::PopUpTalent
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::PopUpTalent
- Defined in:
- lib/omniauth/strategies/pop_up_talent.rb
Constant Summary collapse
- DEFAULT_HOST =
"https://accounts.popuptalent.com"
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(app, opts = {}) ⇒ PopUpTalent
constructor
A new instance of PopUpTalent.
- #raw_info ⇒ Object
Constructor Details
#initialize(app, opts = {}) ⇒ PopUpTalent
Returns a new instance of PopUpTalent.
30 31 32 33 34 35 36 |
# File 'lib/omniauth/strategies/pop_up_talent.rb', line 30 def initialize(app, opts = {}) super(app, opts[:key], opts[:secret]) host = opts[:host] || DEFAULT_HOST [:client_options][:site] = host [:client_options][:token_url] = "#{host}/oauth/authorize" end |
Class Method Details
.invalidate_sessions!(opts = {}) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/omniauth/strategies/pop_up_talent.rb', line 19 def self.invalidate_sessions!(opts = {}) key = opts.fetch(:key) secret = opts.fetch(:secret) host = opts.fetch(:host, DEFAULT_HOST) token = opts.fetch(:token) client = ::OAuth2::Client.new(key, secret, site: host) access_token = ::OAuth2::AccessToken.new(client, token, mode: :query, param_name: :oauth_token) access_token.delete('/current_session') end |
Instance Method Details
#raw_info ⇒ Object
38 39 40 41 42 |
# File 'lib/omniauth/strategies/pop_up_talent.rb', line 38 def raw_info access_token.[:mode] = :query access_token.[:param_name] = 'oauth_token' @raw_info ||= access_token.get('me').parsed end |