omniauth-discord 0.1.0 → 0.1.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 +4 -4
- data/lib/omniauth/discord/version.rb +1 -1
- data/lib/omniauth/strategies/discord.rb +17 -8
- data/omniauth-discord.gemspec +1 -1
- metadata +5 -5
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 0c78e09098f4116ff541df8eea780d86f93025ed
         | 
| 4 | 
            +
              data.tar.gz: 3999ae1aaf509bb951f510455e44905dc8e3364b
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 924091699ce7c197dce61a328aed1dd2ebd61eefb50c3030f3deac6ce9ca8c2a0b094baff60ef33108d3dcedf766e1bca6cc6c32e5d4eeb1f851f7c99bdf0963
         | 
| 7 | 
            +
              data.tar.gz: 189d4cacf3e69d813044e1a48079c9450c92bc5e82bd295d563b313e774edd752475dfd7a9a9aca4e279a43f2dbde1e08cf290285c744ee88dc198139c727bd2
         | 
| @@ -5,16 +5,16 @@ module OmniAuth | |
| 5 5 | 
             
                class Discord < OmniAuth::Strategies::OAuth2
         | 
| 6 6 | 
             
                  DEFAULT_SCOPE = 'email'
         | 
| 7 7 |  | 
| 8 | 
            -
                  option :name,  | 
| 9 | 
            -
             | 
| 8 | 
            +
                  option :name, 'discord'
         | 
| 9 | 
            +
                  
         | 
| 10 10 | 
             
                  option :client_options, {
         | 
| 11 | 
            -
                    :site          => 'https://discordapp.com/api | 
| 12 | 
            -
                    :authorize_url => ' | 
| 13 | 
            -
                    :token_url     => ' | 
| 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  | 
| 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 | 
            -
                       | 
| 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
         | 
    
        data/omniauth-discord.gemspec
    CHANGED
    
    | @@ -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. | 
| 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. | 
| 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- | 
| 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. | 
| 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. | 
| 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. | 
| 151 | 
            +
            rubygems_version: 2.6.6
         | 
| 152 152 | 
             
            signing_key: 
         | 
| 153 153 | 
             
            specification_version: 4
         | 
| 154 154 | 
             
            summary: Discord OAuth2 Strategy for OmniAuth
         |