Skip to content

Commit

Permalink
fix: make shouldDoAutomaticAccountLinking properly get the primary us…
Browse files Browse the repository at this point in the history
…er when linking to oldest user (#907)
  • Loading branch information
porcellus authored Aug 8, 2024
1 parent d80ca83 commit 4fa52c1
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 8 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]

## [20.0.2] - 2024-08-08

- Fixes an issue where `shouldDoAutomaticAccountLinking` was called without a primary user when linking in some cases.

## [20.0.1] - 2024-08-05

- Fixes an issue with `removeFromPayloadByMerge_internal` for `MultiFactorAuthClaim` where it was not retaining other claims while removing the claim from the payload.
Expand Down
2 changes: 1 addition & 1 deletion lib/build/recipe/accountlinking/recipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ class Recipe extends recipeModule_1.default {
// we can use the 0 index cause targetUser is not a primary user.
let shouldDoAccountLinking = await this.config.shouldDoAutomaticAccountLinking(
inputUser.loginMethods[0],
primaryUserThatCanBeLinkedToTheInputUser,
createPrimaryUserResult.user,
session,
tenantId,
userContext
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/accountlinking/recipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ export default class Recipe extends RecipeModule {
// we can use the 0 index cause targetUser is not a primary user.
let shouldDoAccountLinking = await this.config.shouldDoAutomaticAccountLinking(
inputUser.loginMethods[0],
primaryUserThatCanBeLinkedToTheInputUser,
createPrimaryUserResult.user,
session,
tenantId,
userContext
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 = "20.0.1";
export const version = "20.0.2";

export const cdiSupported = ["5.1"];

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": "20.0.1",
"version": "20.0.2",
"description": "NodeJS driver for SuperTokens core",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 4fa52c1

Please sign in to comment.