omniauth-open_wechat 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9f385bb13c3fd98b29292dacd34ab1b5fb45dcf
4
- data.tar.gz: 7a370bf8584653df6b542e033465e85e515c6847
3
+ metadata.gz: 1bfd12f6ef296b0ecd0f068de76413c9c8d37e78
4
+ data.tar.gz: 1ab5bcec0300e0ffb91606816fed6e053a359937
5
5
  SHA512:
6
- metadata.gz: b71d6fd49cfd9006c8b9b6dd36f0a4ec540ddfcb438d489f38b71ac5844ee3c4c0e5bbb69cc516a7fcf767757d37f773547720a74597360b40477b2076463c63
7
- data.tar.gz: ec84e62b73d417863c4bf5fd8f87d1df403fcaf918ac20b9117472639376daab4b44dc48c4e5d5c29594f2c469bcce154785d0e9982b2aa4c1f432fb199abe1d
6
+ metadata.gz: 2f98a59cc3643b7eb2b4434953f2b41a929904b19b32e22dd8101def4e29d95c9459ff33b2b971297f7de235773a0f1d43626ad13c615f53daff9e462c92f288
7
+ data.tar.gz: a27c7b20ea0fe539ce359123198f6cf4677ee487578ce59ee42d8e3f35decb6a8529f9b0beea4024bb7e4113688f638a635e48eae28215b75fba15d324b5617b
data/README.md CHANGED
@@ -29,6 +29,46 @@ Rails.application.config.middleware.use OmniAuth::Builder do
29
29
  end
30
30
  ```
31
31
 
32
+ ## Authentication Hash
33
+
34
+ Here's an example Authentication Hash available in `request.env['omniauth.auth']` :
35
+
36
+ ```
37
+ {
38
+ "provider"=>"open_wechat",
39
+ "uid"=>"xxx...",
40
+ "info"=>{
41
+ "nickname"=>"free",
42
+ "sex"=>1,
43
+ "province"=>"",
44
+ "city"=>"",
45
+ "country"=>"CN",
46
+ "headimgurl"=>"http://wx.qlogo.cn/mmopen/574VdhMFwaGdhhGuGWZicMYibnBSnzYSU8S6c3mJrqneYpm1YmGkBjHX5T9xj4TdeRWfHPmXORTqIt7F0G2y4TJA/0",
47
+ "name"=>"free"
48
+ },
49
+ "credentials"=>{
50
+ "token"=>"xxx...",
51
+ "refresh_token"=>"xxx...",
52
+ "expires_at"=>2015-06-04 16:17:26 +0800,
53
+ "expires"=>true
54
+ },
55
+ "extra"=>{
56
+ "raw_info"=>{
57
+ "openid"=>"xxx...",
58
+ "nickname"=>"free",
59
+ "sex"=>1,
60
+ "language"=>"zh_CN",
61
+ "city"=>"",
62
+ "province"=>"",
63
+ "country"=>"CN",
64
+ "headimgurl"=>"http://wx.qlogo.cn/mmopen/574VdhMFwaGdhhGuGWZicMYibnBSnzYSU8S6c3mJrqneYpm1YmGkBjHX5T9xj4TdeRWfHPmXORTqIt7F0G2y4TJA/0",
65
+ "privilege"=>[],
66
+ "unionid"=>"xxx..."
67
+ }
68
+ }
69
+ }
70
+ ```
71
+
32
72
  ## Contributing
33
73
 
34
74
  1. Fork it ( https://github.com/[my-github-username]/omniauth-open_wechat/fork )
@@ -46,7 +46,7 @@ module OmniAuth
46
46
  @uid ||= access_token["openid"]
47
47
  access_token.options[:mode] = :query
48
48
  access_token.options[:param_name] = 'access_token'
49
- @raw_info ||= access_token.get("/sns/userinfo", :params => {"openid" => @uid}).parsed
49
+ @raw_info ||= JSON access_token.get("/sns/userinfo", :params => {"openid" => @uid}).parsed
50
50
  end
51
51
 
52
52
  protected
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module OpenWechat
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-open_wechat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - free1