Skip to content

Commit

Permalink
fixes missed tenantId passing into claim.build
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhpoddar committed Jul 30, 2023
1 parent 3d2c882 commit ef45bae
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 9 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]

## [15.0.1] - 2023-07-19

- Passes missing `tenantId` to claim build function

## [15.0.0] - 2023-07-19

### Added
Expand Down
2 changes: 1 addition & 1 deletion lib/build/recipe/session/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class SessionWrapper {
const issuer = appInfo.apiDomain.getAsStringDangerous() + appInfo.apiBasePath.getAsStringDangerous();
let finalAccessTokenPayload = Object.assign(Object.assign({}, accessTokenPayload), { iss: issuer });
for (const claim of claimsAddedByOtherRecipes) {
const update = yield claim.build(userId, userContext);
const update = yield claim.build(userId, tenantId, userContext);
finalAccessTokenPayload = Object.assign(Object.assign({}, finalAccessTokenPayload), update);
}
return recipe_1.default.getInstanceOrThrowError().recipeInterfaceImpl.createNewSession({
Expand Down
2 changes: 1 addition & 1 deletion lib/build/version.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/build/version.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/ts/recipe/session/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default class SessionWrapper {
};

for (const claim of claimsAddedByOtherRecipes) {
const update = await claim.build(userId, userContext);
const update = await claim.build(userId, tenantId, userContext);
finalAccessTokenPayload = {
...finalAccessTokenPayload,
...update,
Expand Down
2 changes: 1 addition & 1 deletion lib/ts/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
export const version = "15.0.0";
export const version = "15.0.1";

export const cdiSupported = ["3.0"];

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "supertokens-node",
"version": "15.0.0",
"version": "15.0.1",
"description": "NodeJS driver for SuperTokens core",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion test/with-typescript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1338,7 +1338,7 @@ Session.init({
input.accessTokenPayload = stringClaim.removeFromPayload(input.accessTokenPayload);
input.accessTokenPayload = {
...input.accessTokenPayload,
...(await boolClaim.build(input.userId, input.userContext)),
...(await boolClaim.build(input.userId, input.tenantId, input.userContext)),
lastTokenRefresh: Date.now(),
};
return originalImplementation.createNewSession(input);
Expand Down

0 comments on commit ef45bae

Please sign in to comment.