Class: OmniAuth::Strategies::Traycheckout
- Inherits:
-
Object
- Object
- OmniAuth::Strategies::Traycheckout
- Includes:
- OmniAuth::Strategy
- Defined in:
- lib/omniauth/strategies/traycheckout.rb
Defined Under Namespace
Classes: CallbackError
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
Instance Method Summary collapse
- #auth_hash ⇒ Object
- #authorize_params ⇒ Object
- #callback_phase ⇒ Object
- #client ⇒ Object
- #request_phase ⇒ Object
- #token_params ⇒ Object
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
23 24 25 |
# File 'lib/omniauth/strategies/traycheckout.rb', line 23 def access_token @access_token end |
Instance Method Details
#auth_hash ⇒ Object
60 61 62 |
# File 'lib/omniauth/strategies/traycheckout.rb', line 60 def auth_hash self.credentials end |
#authorize_params ⇒ Object
43 44 45 |
# File 'lib/omniauth/strategies/traycheckout.rb', line 43 def { consumer_key: .consumer_key } end |
#callback_phase ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/omniauth/strategies/traycheckout.rb', line 51 def callback_phase if request.params["code"].blank? fail!('code_blank', CallbackError.new(:code_blank, 'code can not be blank')) else self.access_token = build_access_token super end end |
#client ⇒ Object
25 26 27 28 29 |
# File 'lib/omniauth/strategies/traycheckout.rb', line 25 def client ::OAuth2::Client.new(.consumer_key, .consumer_secret, deep_symbolize(.)) end |
#request_phase ⇒ Object
39 40 41 |
# File 'lib/omniauth/strategies/traycheckout.rb', line 39 def request_phase redirect client.() end |
#token_params ⇒ Object
47 48 49 |
# File 'lib/omniauth/strategies/traycheckout.rb', line 47 def token_params .token_params.merge(("token")) end |