omniauth-miro 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/Gemfile.lock +1 -1
- data/lib/omni_auth/miro/version.rb +1 -1
- data/lib/omni_auth/strategies/miro.rb +32 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0ab2dee53f2e5bb81ac104fae45c9f56183ee6930b260fb122f490d3facfbac
|
4
|
+
data.tar.gz: d35e9ee87991fdd78cdb5e6b088b7315984a0661e7f7057b650ef8c03877a86d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
@@ -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['
|
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.
|
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-
|
11
|
+
date: 2024-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|