omniauth-discord 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06f2e26f9115c5b08b460462de70e2fbf1455928
4
- data.tar.gz: ac15665899d613562ceff35bf72877da5e207e32
3
+ metadata.gz: f0cfff1687d81aa3eefb32e70fa879fe1eb44f91
4
+ data.tar.gz: c29a03b00cf9ebb327ffd2fb14b2f69de575da44
5
5
  SHA512:
6
- metadata.gz: fe31a35a9eceee77426def17fcf343e90ef26948d2642fd2d2dfc7a81747d4bc0f7c1d5332e0cb2b9ffd0d436028824a0a95227401d1d3c22818d3e06b7aa84e
7
- data.tar.gz: 240700d490b44996e55d43ecaf9d7ea142eff77f85a8418b183d966ded0100387ab3252dec2dccef509e40d0ebbd65dcd968d535cf8adf901885474e10945e07
6
+ metadata.gz: 603ce11732ed36580b68585063bba28e926026b527b5db61287b0f6e58d924164fcea84babd3b84188123d4d9a21c14ac5c34c609940b1d84db8115c6eca24c3
7
+ data.tar.gz: 1d4b99627158ba46dd207737496906d0a8a9ac1573c5ffdfa20fd407ba4462b4e928f214d41310ee66a4dfb46443a2ec52f23e12c458f1f500b6878aca26b810
data/.travis.yml CHANGED
@@ -15,7 +15,3 @@ gemfile:
15
15
  notifications:
16
16
  email: false
17
17
 
18
- addons:
19
- code_climate:
20
- repo_token:
21
- secure: "1a6ae0e7db7aaab5f54e634a64bf9278084fca24f3558871356b559b724ce8bf"
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # OmniAuth Discord
1
+ # OmniAuth Discord
2
2
 
3
3
  Discord OAuth2 Strategy for OmniAuth.
4
4
 
@@ -26,6 +26,15 @@ Rails.application.config.middleware.use OmniAuth::Builder do
26
26
  end
27
27
  ```
28
28
 
29
+ By default, Discord does not return a user's email address. Set the scope to
30
+ `email` to get it:
31
+
32
+ ```ruby
33
+ Rails.application.config.middleware.use OmniAuth::Builder do
34
+ provider :discord, ENV['DISCORD_APPID'], ENV['DISCORD_SECRET'], scope: 'email'
35
+ end
36
+ ```
37
+
29
38
  ## Contributing
30
39
 
31
40
  Bug reports and pull requests are welcome on GitHub at https://github.com/adaoraul/omniauth-discord.
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Discord
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
@@ -19,11 +19,9 @@ module OmniAuth
19
19
 
20
20
  info do
21
21
  {
22
- :id => raw_info['id'],
23
- :username => raw_info['username'],
24
- :discriminator => raw_info['discriminator'],
25
- :avatar => raw_info['avatar'],
26
- :verified => raw_info['verified']
22
+ :name => raw_info['username'],
23
+ :email => raw_info['email'],
24
+ :image => "https://cdn.discordapp.com/avatars/#{raw_info['id']}/#{raw_info['avatar']}"
27
25
  }
28
26
  end
29
27
 
@@ -34,7 +32,7 @@ module OmniAuth
34
32
  end
35
33
 
36
34
  def raw_info
37
- @raw_info = access_token.get('users/@me').parsed
35
+ @raw_info ||= access_token.get('users/@me').parsed
38
36
  end
39
37
 
40
38
  def callback_url
@@ -45,7 +43,7 @@ module OmniAuth
45
43
  def authorize_params
46
44
  super.tap do |params|
47
45
  options[:authorize_options].each do |option|
48
- params[option] = request.params[option.to_s]
46
+ params[option] = request.params[option.to_s] if request.params[option.to_s]
49
47
  end
50
48
 
51
49
  params[:redirect_uri] = options[:redirect_uri] unless options[:redirect_uri].nil?
@@ -20,7 +20,6 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.4'
22
22
 
23
- spec.add_development_dependency "codeclimate-test-reporter"
24
23
  spec.add_development_dependency "dotenv"
25
24
  spec.add_development_dependency "bundler"
26
25
  spec.add_development_dependency "rake"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-discord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adão Raul
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-15 00:00:00.000000000 Z
11
+ date: 2017-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.4'
27
- - !ruby/object:Gem::Dependency
28
- name: codeclimate-test-reporter
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: dotenv
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -115,7 +101,6 @@ executables: []
115
101
  extensions: []
116
102
  extra_rdoc_files: []
117
103
  files:
118
- - ".codeclimate.yml"
119
104
  - ".gitignore"
120
105
  - ".rubocop.yml"
121
106
  - ".travis.yml"
@@ -148,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
133
  version: '0'
149
134
  requirements: []
150
135
  rubyforge_project:
151
- rubygems_version: 2.5.1
136
+ rubygems_version: 2.6.11
152
137
  signing_key:
153
138
  specification_version: 4
154
139
  summary: Discord OAuth2 Strategy for OmniAuth
data/.codeclimate.yml DELETED
@@ -1,16 +0,0 @@
1
- ---
2
- engines:
3
- duplication:
4
- enabled: true
5
- config:
6
- languages:
7
- - ruby
8
- fixme:
9
- enabled: true
10
- rubocop:
11
- enabled: true
12
- ratings:
13
- paths:
14
- - "**.rb"
15
- exclude_paths:
16
- - test/