Skip to content

Commit f7de815

Browse files
Merge pull request #400 from supertokens/sdk-fix
fix: session functions
2 parents c66ee33 + 4290f4b commit f7de815

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

CHANGELOG.md

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

88
## [unreleased]
99

10+
1011
## [0.17.5] - 2024-03-14
1112
- 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.
13+
- Fixes the passing of `tenantId` in `getAllSessionHandlesForUser` and `revokeAllSessionsForUser` based on `fetchAcrossAllTenants` and `revokeAcrossAllTenants` inputs respectively.
14+
- Updated fake email generation
1215

1316
## [0.17.4] - 2024-02-08
1417

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
}

recipe/thirdparty/providers/custom.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func NewProvider(input tpmodels.ProviderInput) *tpmodels.TypeProvider {
5151

5252
if input.Config.GenerateFakeEmail == nil {
5353
input.Config.GenerateFakeEmail = func(thirdPartyUserId string, tenantId string, userContext supertokens.UserContext) string {
54-
return fmt.Sprintf("%s@%s.fakeemail.com", thirdPartyUserId, input.Config.ThirdPartyId)
54+
return fmt.Sprintf("%s.%[email protected].com", thirdPartyUserId, input.Config.ThirdPartyId)
5555
}
5656
}
5757

0 commit comments

Comments
 (0)