Class: OmniAuth::Strategies::Linear
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Linear
- Defined in:
- lib/omniauth/strategies/linear.rb
Instance Method Summary collapse
- #authorize_params ⇒ Object
- #callback_url ⇒ Object
- #me ⇒ Object
- #raw_info ⇒ Object
- #request_phase ⇒ Object
Instance Method Details
#authorize_params ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/omniauth/strategies/linear.rb', line 23 def super.tap do |params| %w[client_options].each do |v| if request.params[v] params[v.to_sym] = request.params[v] end end end end |
#callback_url ⇒ Object
72 73 74 |
# File 'lib/omniauth/strategies/linear.rb', line 72 def callback_url full_host + script_name + callback_path end |
#me ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/omniauth/strategies/linear.rb', line 43 def me @me ||= begin http = GraphQL::Client::HTTP.new(..site) do |obj| def headers(context) {"Authorization" => "Bearer #{context[:token]}"} end end schema = GraphQL::Client.load_schema(http) client = GraphQL::Client.new(schema: schema, execute: http) client.allow_dynamic_queries = true gql = client.parse <<~GRAPHQL query { organization { id name } viewer { id name email } } GRAPHQL response = client.query(gql, context: {token: access_token.token}) response.data.to_h end end |
#raw_info ⇒ Object
39 40 41 |
# File 'lib/omniauth/strategies/linear.rb', line 39 def raw_info @raw_info ||= {} end |
#request_phase ⇒ Object
19 20 21 |
# File 'lib/omniauth/strategies/linear.rb', line 19 def request_phase super end |