You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: defaultErrors.New("No SuperTokens core available to query. Please pass supertokens > connectionURI to the init function, or override all the functions of the recipe you are using."),
55
+
LastFetched: 0,
56
+
}
57
+
}
58
+
59
+
varlastErrorerror
60
+
52
61
for_, path:=rangecorePaths {
53
62
// Here we dont need to check if cached result had an error because we only add to cache
// Dont add to cache if there is an error to keep the logic of checking cache simple
119
-
// This means that for multiple cores, the only item we add to cache would be the first
120
-
// core that returned keys without an error
121
-
//
122
-
// This also has the added benefit where if initially the request failed because the core
123
-
// was down and then it comes back up, the next time it will try to request that core again
124
-
// after the cache has expired
125
-
iferr==nil {
126
-
jwksCache=&jwksResult
127
-
}
111
+
// Dont add to cache if there is an error to keep the logic of checking cache simple
112
+
//
113
+
// This also has the added benefit where if initially the request failed because the core
114
+
// was down and then it comes back up, the next time it will try to request that core again
115
+
// after the cache has expired
116
+
jwksCache=&jwksResult
128
117
129
-
ifsupertokens.IsRunningInTestMode() {
130
-
returnedFromCache=false
131
-
}
118
+
ifsupertokens.IsRunningInTestMode() {
119
+
returnedFromCache=false
120
+
}
132
121
133
-
returnjwksResult
134
-
},
135
-
Path: path,
136
-
})
122
+
returnjwksResult
123
+
}
124
+
125
+
lastError=jwksError
137
126
}
138
127
139
-
returnresult
128
+
// This means that fetching from all cores failed
129
+
return sessmodels.GetJWKSResult{
130
+
JWKS: nil,
131
+
Error: lastError,
132
+
LastFetched: 0,
133
+
}
140
134
}
141
135
142
136
/**
@@ -147,29 +141,17 @@ Every core instance a backend is connected to is expected to connect to the same
147
141
token verification. Otherwise, the result of session verification would depend on which core is currently available.
148
142
*/
149
143
funcGetCombinedJWKS() (*keyfunc.JWKS, error) {
150
-
varlastErrorerror
151
-
jwksObjects:=getJWKS()
152
-
153
144
ifsupertokens.IsRunningInTestMode() {
154
145
urlsAttemptedForJWKSFetch= []string{}
155
146
}
156
147
157
-
iflen(jwksObjects) ==0 {
158
-
returnnil, defaultErrors.New("No SuperTokens core available to query. Please pass supertokens > connectionURI to the init function, or override all the functions of the recipe you are using.")
0 commit comments