zaikio-oauth_client 0.16.0 → 0.17.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a2ab7697b4dc9fc67d8558ae29f3ccff27c56c408c1c900e2331ab027c11bf7
|
4
|
+
data.tar.gz: b2a2d6424454e99e57a43cbad9762506d13ffd5709e7ca1dee8f1c2c96d7631b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dc646a77bc4c31ee4ec0affc44017ebf7dc27cdfbd9c950e2fa6f542c030c82ee3be913f50474cc10f714e3c88132bcd601963170c3a02da05e677e8c2f23f1
|
7
|
+
data.tar.gz: 8b120868bccadf82c34a47e9eba11cfd0c3924a5db89c6463264cb1cc7ccbab7bcdad38d6a56138dfbfa334f9807fb200c470ebba7baa223a87d39b0e3cb212f
|
@@ -17,7 +17,7 @@ module Zaikio
|
|
17
17
|
)
|
18
18
|
end
|
19
19
|
|
20
|
-
def approve # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
|
20
|
+
def approve # rubocop:disable Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
21
21
|
if params[:error].present?
|
22
22
|
redirect_to send(
|
23
23
|
respond_to?(:error_path_for) ? :error_path_for : :default_error_path_for,
|
@@ -37,6 +37,7 @@ module Zaikio
|
|
37
37
|
|
38
38
|
origin = session[:origin]
|
39
39
|
session.delete(:origin)
|
40
|
+
session.delete(:oauth_attempts)
|
40
41
|
|
41
42
|
session[:zaikio_access_token_id] = access_token.id unless access_token.organization?
|
42
43
|
|
@@ -44,6 +45,13 @@ module Zaikio
|
|
44
45
|
respond_to?(:after_approve_path_for) ? :after_approve_path_for : :default_after_approve_path_for,
|
45
46
|
access_token, origin
|
46
47
|
)
|
48
|
+
rescue OAuth2::Error => e
|
49
|
+
raise e unless e.code == "invalid_grant"
|
50
|
+
raise e if session[:oauth_attempts].to_i >= 3
|
51
|
+
|
52
|
+
session[:oauth_attempts] = session[:oauth_attempts].to_i + 1
|
53
|
+
|
54
|
+
redirect_to new_path(client_name: params[:client_name])
|
47
55
|
end
|
48
56
|
|
49
57
|
def destroy
|
@@ -59,6 +67,10 @@ module Zaikio
|
|
59
67
|
|
60
68
|
private
|
61
69
|
|
70
|
+
def new_path(options = {})
|
71
|
+
zaikio_oauth_client.new_session_path(options)
|
72
|
+
end
|
73
|
+
|
62
74
|
def approve_url(client_name = nil)
|
63
75
|
zaikio_oauth_client.approve_session_url(client_name)
|
64
76
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zaikio-oauth_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zaikio GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|