omniauth-miro 1.0.1 → 1.0.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
  SHA256:
3
- metadata.gz: 187ca0de86709d87ecd64b49f963aac4f165761a7b86eec04cca58e23d68bb0f
4
- data.tar.gz: c15998209db5d1e07eaa431b73bb7967d0214b93fb26fa6e8b95c29d801cdf8b
3
+ metadata.gz: c0ab2dee53f2e5bb81ac104fae45c9f56183ee6930b260fb122f490d3facfbac
4
+ data.tar.gz: d35e9ee87991fdd78cdb5e6b088b7315984a0661e7f7057b650ef8c03877a86d
5
5
  SHA512:
6
- metadata.gz: be08a6b64feac9bab8242b4e9dc46e5229e4bcc09d46bffd7330acd2a92c2eefb4f99629d8a384e95cb2b890e7d399faa97777ff60334546e4a39c2742a93b00
7
- data.tar.gz: af9d8caa433b195cd66dbaa140d717fc8337e9a21f2ba78d3ceb00a9eab3bfdcc1ebdd2ddd4fd11f2288893e5642b380751d413a32b6630cc81f6daf6947e4d2
6
+ metadata.gz: 9b9e7c08d3cde7848e68fcc659e60c1b8cd856d20f0a6d331fbe59488153214940868cf4ac7c3a12e4b11b14cdf1b64af63ded3dabf13668e1749207a8c305a2
7
+ data.tar.gz: ba1f777d0bd3c5ca0ceca5283dc6f6121c54b36ae4518754a05708a10cf13e97073351bb8e5a7d213fcb0dadf3444c078d83dff80dcf2edae812e93ee1875b6f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
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
+
3
9
  ## [1.0.1]
4
10
 
5
11
  - Bugfix: added client secret to token params request
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-miro (1.0.1)
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.1'
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,7 +26,8 @@ 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
 
@@ -45,6 +46,26 @@ module OmniAuth
45
46
  params[:redirect_uri] = callback_url
46
47
  end
47
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
48
69
  end
49
70
  end
50
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.1
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