Class: OmniAuth::Strategies::Wonde

Inherits:
OAuth2
  • Object
show all
Defined in:
lib/omniauth/strategies/wonde.rb

Overview

Authentication strategy for Wonde

Wonde implements OAuth 2 (three legged)

Constant Summary collapse

USER_INFO_URL =
"https://api.wonde.com/graphql/me"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.user_query_bodyString

Returns JSON string.

Returns:

  • (String)

    JSON string



44
45
46
47
48
49
# File 'lib/omniauth/strategies/wonde.rb', line 44

def self.user_query_body
  @user_query_body ||= begin
    gql = File.read(File.expand_path("user_data.graphql", __dir__))
    { query: gql }.to_json
  end
end

Instance Method Details

#callback_urlString

Returns:

  • (String)


60
61
62
63
64
65
66
67
68
# File 'lib/omniauth/strategies/wonde.rb', line 60

def callback_url
  options[:redirect_uri] ||
    (
      full_host +
      script_name +
      callback_path
    )
  # "#{full_host}#{script_name}#{callback_path}"
end

#raw_infoHash

Returns:

  • (Hash)


52
53
54
55
56
57
# File 'lib/omniauth/strategies/wonde.rb', line 52

def raw_info
  @raw_info ||= begin
    data = .parsed || {}
    data["data"] || {}
  end
end