Class: OmniAuth::Strategies::OpenWechat
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::OpenWechat
- Defined in:
- lib/omniauth/strategies/open_wechat.rb
Instance Method Summary collapse
Instance Method Details
#raw_info ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/omniauth/strategies/open_wechat.rb', line 45 def raw_info @uid ||= access_token["openid"] @raw_info ||= begin access_token.[:mode] = :query if access_token["scope"] && access_token["scope"].include?("snsapi_login") @raw_info = access_token.get("/sns/userinfo", :params => {"openid" => @uid}, parse: :json).parsed else @raw_info = {"openid" => @uid } end end end |
#request_phase ⇒ Object
39 40 41 42 43 |
# File 'lib/omniauth/strategies/open_wechat.rb', line 39 def request_phase params = client.auth_code..merge(redirect_uri: callback_url).merge() params["appid"] = params.delete("client_id") redirect client.(params) end |