omniauth-meli 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: d195617c64f92905dc97b2f08e609d944208c5bac27ce4c63331273fa432b72b
4
- data.tar.gz: '0992218f027eb10b303744b8cd980f171a0e255d69676953593d22a9c5b5a4ce'
3
+ metadata.gz: 699edb93735102d184a4c70a72effa597d2d5881774a8b550ed2aedce8047b1b
4
+ data.tar.gz: 7a994dfde5322316ea45e06d48fc65fc4f85fce9b32864efd5233987cde6efdb
5
5
  SHA512:
6
- metadata.gz: d7e217aef859846eeaca9f43e4f437a3e0718acc52a20deb59ef7b2d1ef7fc166fc8766dd6845cb16d83932d4f608c65a104bc29c19e30b1afdfdae8b2e32b0f
7
- data.tar.gz: e899048bff0fa5664564a78fe2d6fd488e1ccddeedfd8cf364887b2b546c6eed19c145af177dbee5d12fac19bad3ba08f5657139eb398ca73cd8490ca6ffbb16
6
+ metadata.gz: eb37666e3512a92ec0a59249e7aa196ecdbe3e339afbefe0294d016f379f9d1fbf0251214b15e426ad560a457d7a08571bde5d7b1ba352d9f5f68746893d93d9
7
+ data.tar.gz: f7585f6c540a937f53d0fa5114035ea86a5cd7e5c6dadf107a901d1d22297b7931eb7eba66712576a9fe4b94b93fc3656afd6e795cb50be7b97c1d28e9257c68
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module Meli
5
- VERSION = '0.1.2'
5
+ VERSION = '0.1.3'
6
6
  end
7
7
  end
@@ -4,9 +4,9 @@ require 'omniauth-oauth2'
4
4
 
5
5
  module OmniAuth
6
6
  module Strategies
7
- # Omniauth strategy for authenticating with GitHub via OAuth2
7
+ # Omniauth strategy for authenticating with Mercado Livre via OAuth2
8
8
  class Meli < OmniAuth::Strategies::OAuth2
9
- option :name, 'mercadolivre'
9
+ option :name, 'meli'
10
10
 
11
11
  option :client_options, {
12
12
  site: 'https://api.mercadolibre.com',
@@ -40,7 +40,7 @@ module OmniAuth
40
40
  super.tap do |params|
41
41
  params[:response_type] = 'code'
42
42
  params[:client_id] = client.id
43
- params[:redirect_uri] = callback_url.to_s.downcase
43
+ params[:redirect_uri] = callback_url
44
44
  end
45
45
  end
46
46
 
@@ -48,7 +48,7 @@ module OmniAuth
48
48
  client.get_token(
49
49
  {
50
50
  code: request.params['code'],
51
- redirect_uri: callback_url.to_s.downcase,
51
+ redirect_uri: redirect_url,
52
52
  client_id: client.id,
53
53
  client_secret: client.secret,
54
54
  grant_type: 'authorization_code'
@@ -57,7 +57,11 @@ module OmniAuth
57
57
  end
58
58
 
59
59
  def raw_info
60
- @raw_info ||= access_token.get('users/me', { params: access_token.hash }).parsed || {}
60
+ @raw_info ||= access_token.get('users/me', params: access_token.to_hash).parsed || {}
61
+ end
62
+
63
+ def redirect_url
64
+ full_host + callback_path
61
65
  end
62
66
 
63
67
  private
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- $LOAD_PATH.push File.expand_path('lib', __dir__)
4
-
5
3
  require_relative 'lib/omniauth/meli/version'
6
4
 
7
5
  Gem::Specification.new do |gem|
@@ -21,7 +19,7 @@ Gem::Specification.new do |gem|
21
19
  gem.require_paths = ['lib']
22
20
  gem.required_ruby_version = '>= 3.2'
23
21
 
24
- gem.add_dependency 'omniauth', '~> 2.1.2'
22
+ gem.add_dependency 'omniauth', '~> 2.0'
25
23
  gem.add_dependency 'omniauth-oauth2', '~> 1.8'
26
24
  gem.add_development_dependency 'rspec', '~> 3.5'
27
25
  gem.add_development_dependency 'rubocop', '~> 1.50.1'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-meli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elton Fonseca
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-22 00:00:00.000000000 Z
11
+ date: 2024-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.1.2
19
+ version: '2.0'
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: 2.1.2
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: omniauth-oauth2
29
29
  requirement: !ruby/object:Gem::Requirement