Skip to content

Commit

Permalink
Merge pull request #400 from supertokens/sdk-fix
Browse files Browse the repository at this point in the history
fix: session functions
  • Loading branch information
rishabhpoddar authored Mar 18, 2024
2 parents c66ee33 + 4290f4b commit f7de815
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]


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

## [0.17.4] - 2024-02-08

Expand Down
10 changes: 9 additions & 1 deletion recipe/session/sessionFunctions.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ func revokeAllSessionsForUserHelper(querier supertokens.Querier, userID string,
}
if revokeAcrossAllTenants != nil {
requestBody["revokeAcrossAllTenants"] = *revokeAcrossAllTenants

if *revokeAcrossAllTenants {
tenantId = "" // so that we don't pass the tenantId in the url
}
}
response, err := querier.SendPostRequest(tenantId+"/recipe/session/remove", requestBody, userContext)
if err != nil {
Expand All @@ -299,8 +303,12 @@ func getAllSessionHandlesForUserHelper(querier supertokens.Querier, userID strin
}
if fetchAcrossAllTenants != nil {
queryParams["fetchAcrossAllTenants"] = strings.ToLower(fmt.Sprintf("%v", *fetchAcrossAllTenants))

if *fetchAcrossAllTenants {
tenantId = "" // so that we don't pass the tenantId in the url
}
}
response, err := querier.SendGetRequest("/recipe/session/user", queryParams, userContext)
response, err := querier.SendGetRequest(tenantId+"/recipe/session/user", queryParams, userContext)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion recipe/thirdparty/providers/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func NewProvider(input tpmodels.ProviderInput) *tpmodels.TypeProvider {

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

Expand Down

0 comments on commit f7de815

Please sign in to comment.