Skip to content

Commit 919bb21

Browse files
committed
fix: also checking if ShouldRefetch func is not nil
1 parent 4e21146 commit 919bb21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

recipe/session/recipeImplementation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ func makeRecipeImplementation(querier supertokens.Querier, config sessmodels.Typ
233233
for _, validator := range claimValidators {
234234
supertokens.LogDebugMessage("updateClaimsInPayloadIfNeeded checking shouldRefetch for " + validator.ID)
235235
claim := validator.Claim
236-
if claim != nil {
236+
if claim != nil && validator.ShouldRefetch != nil {
237237
if validator.ShouldRefetch(accessTokenPayload, userContext) {
238238
supertokens.LogDebugMessage("updateClaimsInPayloadIfNeeded refetching " + validator.ID)
239239
value, err := claim.FetchValue(userId, userContext)

0 commit comments

Comments
 (0)