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
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/omniauth/strategies/linear.rb', line 25 def super.tap do |params| %w[client_options].each do |v| if request.params[v] params[v.to_sym] = request.params[v] end end params[:actor] = [:actor] end end |
#callback_url ⇒ Object
75 76 77 |
# File 'lib/omniauth/strategies/linear.rb', line 75 def callback_url "#{full_host}#{callback_path}" end |
#me ⇒ Object
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 71 72 73 |
# File 'lib/omniauth/strategies/linear.rb', line 46 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 " query {\n organization {\n id\n name\n }\n viewer {\n id\n name\n email\n }\n }\n GRAPHQL\n response = client.query(gql, context: {token: access_token.token})\n response.data.to_h\n end\nend\n" |
#raw_info ⇒ Object
42 43 44 |
# File 'lib/omniauth/strategies/linear.rb', line 42 def raw_info @raw_info ||= {} end |
#request_phase ⇒ Object
21 22 23 |
# File 'lib/omniauth/strategies/linear.rb', line 21 def request_phase super end |