Skip to content

Commit df22f25

Browse files
committed
fix: session functions
1 parent c66ee33 commit df22f25

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [unreleased]
99

10+
## [0.17.6] - 2024-03-18
11+
12+
- Fixes the passing of `tenantId` in `getAllSessionHandlesForUser` and `revokeAllSessionsForUser` based on `fetchAcrossAllTenants` and `revokeAcrossAllTenants` inputs respectively.
13+
1014
## [0.17.5] - 2024-03-14
1115
- Adds a type uint64 to the `accessTokenCookiesExpiryDurationMillis` local variable in `recipe/session/utils.go`. It also removes the redundant `uint64` type forcing needed because of the untyped variable.
1216

recipe/session/sessionFunctions.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@ func revokeAllSessionsForUserHelper(querier supertokens.Querier, userID string,
276276
}
277277
if revokeAcrossAllTenants != nil {
278278
requestBody["revokeAcrossAllTenants"] = *revokeAcrossAllTenants
279+
280+
if *revokeAcrossAllTenants {
281+
tenantId = "" // so that we don't pass the tenantId in the url
282+
}
279283
}
280284
response, err := querier.SendPostRequest(tenantId+"/recipe/session/remove", requestBody, userContext)
281285
if err != nil {
@@ -299,8 +303,12 @@ func getAllSessionHandlesForUserHelper(querier supertokens.Querier, userID strin
299303
}
300304
if fetchAcrossAllTenants != nil {
301305
queryParams["fetchAcrossAllTenants"] = strings.ToLower(fmt.Sprintf("%v", *fetchAcrossAllTenants))
306+
307+
if *fetchAcrossAllTenants {
308+
tenantId = "" // so that we don't pass the tenantId in the url
309+
}
302310
}
303-
response, err := querier.SendGetRequest("/recipe/session/user", queryParams, userContext)
311+
response, err := querier.SendGetRequest(tenantId+"/recipe/session/user", queryParams, userContext)
304312
if err != nil {
305313
return nil, err
306314
}

supertokens/constants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const (
2121
)
2222

2323
// VERSION current version of the lib
24-
const VERSION = "0.17.5"
24+
const VERSION = "0.17.6"
2525

2626
var (
2727
cdiSupported = []string{"3.0"}

0 commit comments

Comments
 (0)