omniauth-qiita-v2 1.1.0 → 1.2.0

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
  SHA256:
3
- metadata.gz: 424b52c57a9f6b4c14c26c7a79ed09d330c051c17886e8d74da66b16b6c2ff42
4
- data.tar.gz: 4de61e6df80dc4eb7f8fb0c68874334103edcc3bc89374e29649a50724d9fb60
3
+ metadata.gz: 723fdf502a13203f171cbaf1d228a9e0774d2cb157af55113f6b5c768a3e03b5
4
+ data.tar.gz: 0422fb4583d5e2a5e05cedd0bf89c707e2e4534492df962a9c2db01b7441542f
5
5
  SHA512:
6
- metadata.gz: e03046a56547011c65d3dd0e63158e0a5ac8ad41102bb8f5375fe58f60593640f625b252921ba5a07d16788f707f289e3216880417a69602e21d9238df6869ce
7
- data.tar.gz: '04533491a11893817248515f945e15df810dba5bf6cdb76b41322a8cbdce801d2d2d128318f5d2a70c04f395584033c59b212e8fed8391e4bf24d9812f990ce6'
6
+ metadata.gz: a8f5231dec93c33da16d4a561f4009ad7a6ee71e9dddf1723930dbb844d6981299b0e58c764454f8cf4c3d406669520bab1ad607d54e5f0d43d67bcdb1607b75
7
+ data.tar.gz: d45af3b090a655e8de37e8099a983a72c243a4198de6cdd753013e274189f0f400a1a3ee8d3174163bd249225609e3fd1792c8fdd647f460775b04b1d7d2c53f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.2.0] - 2025-07-16
4
+
5
+ - Refactor: Refactoring
6
+ - Test: Update test
7
+ - Other: Update README.md
8
+
3
9
  ## [1.1.0] - 2025-07-15
4
10
 
5
11
  - New: Add `permanent_id` and `organization` to auth hash
data/README.md CHANGED
@@ -57,7 +57,7 @@ Add the OmniAuth configuration to your Devise model:
57
57
  class User < ApplicationRecord
58
58
  devise :database_authenticatable, :registerable,
59
59
  :recoverable, :rememberable, :validatable,
60
- :omniauthable, omniauth_providers: %i[qiita_v2]
60
+ :omniauthable, omniauth_providers: [:qiita_v2]
61
61
  end
62
62
  ```
63
63
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module QiitaV2
5
- VERSION = '1.1.0'
5
+ VERSION = '1.2.0'
6
6
  end
7
7
  end
@@ -89,7 +89,7 @@ module OmniAuth
89
89
  end
90
90
 
91
91
  def callback_url
92
- options[:redirect_uri] || (full_host + script_name + callback_path)
92
+ options[:redirect_uri] || (full_host + callback_path)
93
93
  end
94
94
 
95
95
  def authorize_params
@@ -102,6 +102,12 @@ module OmniAuth
102
102
  end
103
103
  end
104
104
 
105
+ protected
106
+
107
+ def build_access_token
108
+ client.get_token(base_params.merge(token_params_from_options).merge(deep_symbolize(options.auth_token_params)))
109
+ end
110
+
105
111
  private
106
112
 
107
113
  def prune!(hash)
@@ -111,30 +117,14 @@ module OmniAuth
111
117
  end
112
118
  end
113
119
 
114
- def build_access_token
115
- client.get_token(access_token_params)
116
- rescue ::OAuth2::Error => e
117
- log :error, "Failed to build access token: #{e.message}"
118
- fail!(:invalid_credentials, e)
119
- rescue ::Timeout::Error, ::Errno::ETIMEDOUT => e
120
- log :error, "Timeout during token exchange: #{e.message}"
121
- fail!(:timeout, e)
122
- end
123
-
124
- def access_token_params
125
- base_params
126
- .merge(token_params_from_options)
127
- .merge(deep_symbolize(options.auth_token_params))
128
- end
129
-
130
120
  def base_params
131
121
  {
132
122
  headers: {
133
123
  'Content-Type' => 'application/json'
134
124
  },
135
- redirect_uri: callback_url,
136
125
  client_id: options.client_id,
137
126
  client_secret: options.client_secret,
127
+ redirect_uri: callback_url,
138
128
  code: request.params['code']
139
129
  }
140
130
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-qiita-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro
@@ -66,15 +66,15 @@ files:
66
66
  - lib/omniauth-qiita-v2.rb
67
67
  - lib/omniauth/qiita_v2/version.rb
68
68
  - lib/omniauth/strategies/qiita_v2.rb
69
- homepage: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.1.0
69
+ homepage: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.2.0
70
70
  licenses:
71
71
  - MIT
72
72
  metadata:
73
- homepage_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.1.0
74
- source_code_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.1.0
75
- changelog_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/blob/v1.1.0/CHANGELOG.md
73
+ homepage_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.2.0
74
+ source_code_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.2.0
75
+ changelog_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/blob/v1.2.0/CHANGELOG.md
76
76
  bug_tracker_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/issues
77
- documentation_uri: https://rubydoc.info/gems/omniauth-qiita-v2/1.1.0
77
+ documentation_uri: https://rubydoc.info/gems/omniauth-qiita-v2/1.2.0
78
78
  funding_uri: https://patreon.com/CadenzaTech
79
79
  rubygems_mfa_required: 'true'
80
80
  rdoc_options: []
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  - !ruby/object:Gem::Version
92
92
  version: '0'
93
93
  requirements: []
94
- rubygems_version: 3.6.7
94
+ rubygems_version: 3.6.9
95
95
  specification_version: 4
96
96
  summary: Qiita strategy for OmniAuth
97
97
  test_files: []