zuora_connect 1.3.5 → 1.3.6
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8d9176bc539ca261c0808ec6fddde1cf653a47d
|
4
|
+
data.tar.gz: 30fa383c291232a21b5cb56f50e69518d5e82abf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbf5cbb6f652735b1d2a1fa30b67722c2fcc5312ded1058a7b337426007ca92b2de345157ed8d761114d021821bbfbb5b5b49c917a5f24497f56b602ff28231c
|
7
|
+
data.tar.gz: d4294c4652efa8f9364e8af17eaaf300bdaab7727a9179f7c259e7225d95a9fc6662e15eb8700d1dddf0b99f04a693b27988975d7a9fd4f3745b634709f0a106
|
@@ -17,11 +17,11 @@ module ZuoraConnect
|
|
17
17
|
Thread.current[:appinstance] = self
|
18
18
|
end
|
19
19
|
|
20
|
-
def data_lookup(session)
|
20
|
+
def data_lookup(session: nil)
|
21
21
|
return session.blank? ? {} : session
|
22
22
|
end
|
23
23
|
|
24
|
-
def new_session(session:
|
24
|
+
def new_session(session: self.data_lookup, username: self.access_token, password: self.refresh_token)
|
25
25
|
@api_version = (username.include?("@") ? "v1" : "v2")
|
26
26
|
@username = username
|
27
27
|
@password = password
|
@@ -32,7 +32,9 @@ module ZuoraConnect
|
|
32
32
|
else
|
33
33
|
setup_instance_via_dev_mode
|
34
34
|
end
|
35
|
-
|
35
|
+
#Call .data_lookup with the current session to retrieve session. In some cases session may be stored/cache in redis
|
36
|
+
#so data lookup provides a model method that can be overriden per app.
|
37
|
+
@appinstance.new_session(:session => @appinstance.data_lookup(:session => session))
|
36
38
|
I18n.locale = session["#{@appinstance.id}::user::locale"] ? session["#{@appinstance.id}::user::locale"] : @appinstance.locale
|
37
39
|
Time.zone = session["#{@appinstance.id}::user::timezone"] ? session["#{@appinstance.id}::user::timezone"] : @appinstance.timezone
|
38
40
|
Rails.logger.debug("[#{@appinstance.blank? ? "N/A" : @appinstance.id}] Authenticate App Request Completed In - #{(Time.now - start_time).round(2)}s")
|
@@ -112,7 +114,7 @@ module ZuoraConnect
|
|
112
114
|
|
113
115
|
def check_instance
|
114
116
|
if !@appinstance.blank?
|
115
|
-
@appinstance.new_session(:session => @appinstance.data_lookup(session))
|
117
|
+
@appinstance.new_session(:session => @appinstance.data_lookup(:session => session))
|
116
118
|
Thread.current[:appinstance] = @appinstance
|
117
119
|
return @appinstance.valid
|
118
120
|
else
|