omniauth-discord 0.1.0 → 0.1.2

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: 393e98d67eed8776b8864146d26b0cd5b55107e8
4
- data.tar.gz: 5946058ff11b2653f88b47faea42b04faba0b462
3
+ metadata.gz: 0c78e09098f4116ff541df8eea780d86f93025ed
4
+ data.tar.gz: 3999ae1aaf509bb951f510455e44905dc8e3364b
5
5
  SHA512:
6
- metadata.gz: d257847ba62e6b73a1a9e2d58a1a0f94c5cf91a6bfc95de3ad1d7280ccb18da73de5c864227edc636d78157989a3097e3665a4fe5f6aae2df3702023ad23b793
7
- data.tar.gz: 7443e47ab7692b7c4dbbb51b619aea2f13e71cd405a757eebceb30066f4bd367fa0e0788da2bf8bdb58c98b4732700d12e8e2568f57c612f9b3a43f270640cc9
6
+ metadata.gz: 924091699ce7c197dce61a328aed1dd2ebd61eefb50c3030f3deac6ce9ca8c2a0b094baff60ef33108d3dcedf766e1bca6cc6c32e5d4eeb1f851f7c99bdf0963
7
+ data.tar.gz: 189d4cacf3e69d813044e1a48079c9450c92bc5e82bd295d563b313e774edd752475dfd7a9a9aca4e279a43f2dbde1e08cf290285c744ee88dc198139c727bd2
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Discord
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -5,16 +5,16 @@ module OmniAuth
5
5
  class Discord < OmniAuth::Strategies::OAuth2
6
6
  DEFAULT_SCOPE = 'email'
7
7
 
8
- option :name, "discord"
9
-
8
+ option :name, 'discord'
9
+
10
10
  option :client_options, {
11
- :site => 'https://discordapp.com/api/oauth2/',
12
- :authorize_url => 'https://discordapp.com/api/oauth2/authorize',
13
- :token_url => 'https://discordapp.com/api/oauth2/token'
11
+ :site => 'https://discordapp.com/api',
12
+ :authorize_url => 'oauth2/authorize',
13
+ :token_url => 'oauth2/token'
14
14
  }
15
15
 
16
16
  option :authorize_options, [:scope]
17
-
17
+
18
18
  uid { raw_info['id'] }
19
19
 
20
20
  info do
@@ -35,12 +35,21 @@ module OmniAuth
35
35
  end
36
36
 
37
37
  def raw_info
38
- @raw_info ||= access_token.get('/users/@me').parsed
38
+ @raw_info = access_token.get('users/@me').parsed
39
+ end
40
+
41
+ def callback_url
42
+ # Discord does not support query parameters
43
+ full_host + script_name + callback_path
39
44
  end
40
45
 
41
46
  def authorize_params
42
47
  super.tap do |params|
43
- params[:scope] = request.params['scope']
48
+ options[:authorize_options].each do |option|
49
+ params[option] = request.params[option.to_s]
50
+ end
51
+
52
+ params[:redirect_uri] = options[:redirect_uri] unless options[:redirect_uri].nil?
44
53
  params[:scope] ||= DEFAULT_SCOPE
45
54
  end
46
55
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.2'
21
+ spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.4'
22
22
 
23
23
  spec.add_development_dependency "codeclimate-test-reporter"
24
24
  spec.add_development_dependency "dotenv"
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.0
4
+ version: 0.1.2
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-06-16 00:00:00.000000000 Z
11
+ date: 2016-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.2'
19
+ version: '1.4'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.2'
26
+ version: '1.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: codeclimate-test-reporter
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  version: '0'
149
149
  requirements: []
150
150
  rubyforge_project:
151
- rubygems_version: 2.5.1
151
+ rubygems_version: 2.6.6
152
152
  signing_key:
153
153
  specification_version: 4
154
154
  summary: Discord OAuth2 Strategy for OmniAuth