go_to_webinar 0.2.9 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/go_to_webinar/client.rb +16 -10
- data/lib/go_to_webinar/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df9fa769ff6179ab77d56cceedefffd4cebc66af444b7b903c91ec9dd149b915
|
4
|
+
data.tar.gz: 8f602a443a9f18616ed3d9aa6186cd8d732216b2bf4c28b1b16ad867c131c8fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 808a2e7d986daa91aea2587dcbf6d6b63adce397fffed7d7890788f4678c033661caa28ea78274bc525b9980c8e9d59c2e8ed95e171d9207b505ba035f26ce79
|
7
|
+
data.tar.gz: cdc2f267d736529bc83fdb63b328c3a620d70e6f61e35dcc3780b1abcd427ae3e50a1cb0e6b065be10050d924d70b99854ec13dc2f74142419ac2b0d5581491b
|
data/lib/go_to_webinar/client.rb
CHANGED
@@ -46,17 +46,23 @@ module GoToWebinar
|
|
46
46
|
retries ||= 0
|
47
47
|
yield
|
48
48
|
rescue RestClient::Forbidden => e
|
49
|
+
raise unless (retries += 1) < 2
|
50
|
+
|
51
|
+
attempt_refresh(e)
|
52
|
+
retry
|
53
|
+
rescue StandardError => e
|
49
54
|
raise unless (retries += 1) <= 2
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
55
|
+
|
56
|
+
@g2w_oauth2_client.get_new_access_token
|
57
|
+
@access_token = @g2w_oauth2_client.access_token&.token
|
58
|
+
retry
|
59
|
+
end
|
60
|
+
|
61
|
+
def attempt_refresh(e)
|
62
|
+
raise unless int_error_code(e) == 'InvalidToken'
|
63
|
+
raise unless @g2w_oauth2_client&.access_token&.expired?
|
64
|
+
|
65
|
+
@access_token = @g2w_oauth2_client.refresh_access_token.token
|
60
66
|
end
|
61
67
|
|
62
68
|
def int_error_code(exception)
|