omniauth-miro 1.0.0 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5cc474775b124338f8f92ae946477d796f6e56a6d05d37a766061458685cd6e
4
- data.tar.gz: 17a7311149f2706f295defca7024fdac8dd5ddb922288852b73842c1ec901804
3
+ metadata.gz: c0ab2dee53f2e5bb81ac104fae45c9f56183ee6930b260fb122f490d3facfbac
4
+ data.tar.gz: d35e9ee87991fdd78cdb5e6b088b7315984a0661e7f7057b650ef8c03877a86d
5
5
  SHA512:
6
- metadata.gz: 2d89e74ef9d0bebf0fc1def6070f748658cc41a2c3bd23e5b31a227a469a2945348655a60cc17af5c9ba036fabde98f0afe32ff40bd68b9eb6dbc6e85abcf55d
7
- data.tar.gz: 01a5779d24c2661b4687d69a12f0e9c51cfdf202e30d7673ea7dd4a6e4fd807b08c2c0576801379cef3e0caba1ab900f03614ce0707d3cca478f7eb7f2877b31
6
+ metadata.gz: 9b9e7c08d3cde7848e68fcc659e60c1b8cd856d20f0a6d331fbe59488153214940868cf4ac7c3a12e4b11b14cdf1b64af63ded3dabf13668e1749207a8c305a2
7
+ data.tar.gz: ba1f777d0bd3c5ca0ceca5283dc6f6121c54b36ae4518754a05708a10cf13e97073351bb8e5a7d213fcb0dadf3444c078d83dff80dcf2edae812e93ee1875b6f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.2]
4
+
5
+ - Update uid to use organization id id
6
+ - Added token response into omniauth hash
7
+ - Overwrite callback_phase method to not fail upon missing refresh token
8
+
9
+ ## [1.0.1]
10
+
11
+ - Bugfix: added client secret to token params request
12
+ - Updated to full url for context endpoint
13
+
3
14
  ## [1.0.0]
4
15
 
5
16
  - New omniauth-miro strategy for Miro OAuth 2.0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-miro (1.0.0)
4
+ omniauth-miro (1.0.2)
5
5
  omniauth (>= 1, < 3)
6
6
  omniauth-oauth2 (~> 1.1)
7
7
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module Miro
5
- VERSION = '1.0.0'
5
+ VERSION = '1.0.2'
6
6
  end
7
7
  end
@@ -13,7 +13,7 @@ module OmniAuth
13
13
  token_url: 'https://api.miro.com/v1/oauth/token'
14
14
  }
15
15
 
16
- uid { raw_info['team']['id'] }
16
+ uid { raw_info['organization']['id'] }
17
17
 
18
18
  info do
19
19
  {
@@ -26,17 +26,46 @@ module OmniAuth
26
26
 
27
27
  extra do
28
28
  {
29
- raw_info: raw_info
29
+ raw_info: raw_info,
30
+ token_info: access_token
30
31
  }
31
32
  end
32
33
 
33
34
  def raw_info
34
- @raw_info ||= access_token.get('/v1/oauth-token').parsed
35
+ @raw_info ||= access_token.get('https://api.miro.com/v1/oauth-token').parsed
35
36
  end
36
37
 
37
38
  def callback_url
38
39
  full_host + callback_path
39
40
  end
41
+
42
+ def token_params
43
+ super.tap do |params|
44
+ params[:client_id] = client.id
45
+ params[:client_secret] = client.secret
46
+ params[:redirect_uri] = callback_url
47
+ end
48
+ end
49
+
50
+ def callback_phase
51
+ error = request.params['error_reason'] || request.params['error']
52
+ if !options.provider_ignores_state && (request.params['state'].to_s.empty? || request.params['state'] != session.delete('omniauth.state'))
53
+ fail!(:csrf_detected, CallbackError.new(:csrf_detected, 'CSRF detected'))
54
+ elsif error
55
+ fail!(error,
56
+ CallbackError.new(request.params['error'], request.params['error_description'] || request.params['error_reason'], request.params['error_uri']))
57
+ else
58
+ self.access_token = build_access_token
59
+ env['omniauth.auth'] = auth_hash
60
+ call_app!
61
+ end
62
+ rescue ::OAuth2::Error, CallbackError => e
63
+ fail!(:invalid_credentials, e)
64
+ rescue ::Timeout::Error, ::Errno::ETIMEDOUT => e
65
+ fail!(:timeout, e)
66
+ rescue ::SocketError => e
67
+ fail!(:failed_to_connect, e)
68
+ end
40
69
  end
41
70
  end
42
71
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-miro
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rewind Software Inc. | Calvin Chen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-19 00:00:00.000000000 Z
11
+ date: 2024-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth