Class: OmniAuth::Strategies::Monday
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Monday
- Defined in:
- lib/omniauth/strategies/monday.rb
Instance Method Summary collapse
- #authorize_params ⇒ Object
- #callback_url ⇒ Object
- #me ⇒ Object
- #query ⇒ Object
- #raw_info ⇒ Object
- #request_phase ⇒ Object
Instance Method Details
#authorize_params ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/omniauth/strategies/monday.rb', line 16 def super.tap do |params| %w[client_options].each do |v| params[v.to_sym] = request.params[v] if request.params[v] end end end |
#callback_url ⇒ Object
42 43 44 |
# File 'lib/omniauth/strategies/monday.rb', line 42 def callback_url full_host + script_name + callback_path end |
#me ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/omniauth/strategies/monday.rb', line 34 def me @me ||= begin access_token.[:mode] = :header response = access_token.post("", body: { query: query }).parsed response["data"]["me"].merge("account_id": response["account_id"]) end end |
#query ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/omniauth/strategies/monday.rb', line 46 def query <<~GRAPHQL query { me { email name id } } GRAPHQL end |
#raw_info ⇒ Object
30 31 32 |
# File 'lib/omniauth/strategies/monday.rb', line 30 def raw_info @raw_info ||= {} end |
#request_phase ⇒ Object
12 13 14 |
# File 'lib/omniauth/strategies/monday.rb', line 12 def request_phase super end |