Skip to content

Commit

Permalink
fix: session functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvikc committed Mar 18, 2024
1 parent c66ee33 commit df22f25
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

## [0.17.6] - 2024-03-18

- Fixes the passing of `tenantId` in `getAllSessionHandlesForUser` and `revokeAllSessionsForUser` based on `fetchAcrossAllTenants` and `revokeAcrossAllTenants` inputs respectively.

## [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.

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 supertokens/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (
)

// VERSION current version of the lib
const VERSION = "0.17.5"
const VERSION = "0.17.6"

var (
cdiSupported = []string{"3.0"}
Expand Down

0 comments on commit df22f25

Please sign in to comment.