From 706177fd097c15b71208fcd1c3a6354004b379af Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Fri, 7 Jul 2023 18:30:51 +0530 Subject: [PATCH] fix: missed param --- lib/build/recipe/emailpassword/utils.js | 2 +- lib/build/recipe/emailverification/utils.js | 2 +- lib/build/recipe/passwordless/utils.js | 2 +- lib/build/recipe/thirdpartyemailpassword/index.d.ts | 1 + lib/build/recipe/thirdpartyemailpassword/index.js | 11 ++++++++--- lib/build/recipe/thirdpartyemailpassword/types.d.ts | 1 + lib/build/recipe/thirdpartyemailpassword/utils.js | 2 +- lib/build/recipe/thirdpartypasswordless/utils.js | 2 +- lib/ts/recipe/thirdpartyemailpassword/index.ts | 3 +++ lib/ts/recipe/thirdpartyemailpassword/types.ts | 1 + 10 files changed, 19 insertions(+), 8 deletions(-) diff --git a/lib/build/recipe/emailpassword/utils.js b/lib/build/recipe/emailpassword/utils.js index 06e998f29..30c3fc21d 100644 --- a/lib/build/recipe/emailpassword/utils.js +++ b/lib/build/recipe/emailpassword/utils.js @@ -76,7 +76,7 @@ function validateAndNormaliseUserInput(recipeInstance, appInfo, config) { : _a.service; /** * following code is for backward compatibility. - * if user has not passed emailDelivery config, we use the default + * if user has not passed emailService config, we use the default * createAndSendEmailUsingSupertokensService implementation which calls our supertokens API */ if (emailService === undefined) { diff --git a/lib/build/recipe/emailverification/utils.js b/lib/build/recipe/emailverification/utils.js index e1adb446c..d3072cf03 100644 --- a/lib/build/recipe/emailverification/utils.js +++ b/lib/build/recipe/emailverification/utils.js @@ -34,7 +34,7 @@ function validateAndNormaliseUserInput(_, appInfo, config) { let emailService = (_a = config.emailDelivery) === null || _a === void 0 ? void 0 : _a.service; /** * following code is for backward compatibility. - * if user has not passed emailDelivery config, we use the default + * if user has not passed emailService config, we use the default * createAndSendEmailUsingSupertokensService implementation which calls our supertokens API */ if (emailService === undefined) { diff --git a/lib/build/recipe/passwordless/utils.js b/lib/build/recipe/passwordless/utils.js index ac0f1dedf..8e8a98fd4 100644 --- a/lib/build/recipe/passwordless/utils.js +++ b/lib/build/recipe/passwordless/utils.js @@ -46,7 +46,7 @@ function validateAndNormaliseUserInput(_, appInfo, config) { let emailService = (_a = config.emailDelivery) === null || _a === void 0 ? void 0 : _a.service; /** * following code is for backward compatibility. - * if user has not passed emailDelivery config, we use the default + * if user has not passed emailService config, we use the default * createAndSendEmailUsingSupertokensService implementation */ if (emailService === undefined) { diff --git a/lib/build/recipe/thirdpartyemailpassword/index.d.ts b/lib/build/recipe/thirdpartyemailpassword/index.d.ts index 31b452ae9..62a4f7ca8 100644 --- a/lib/build/recipe/thirdpartyemailpassword/index.d.ts +++ b/lib/build/recipe/thirdpartyemailpassword/index.d.ts @@ -97,6 +97,7 @@ export default class Wrapper { password?: string; userContext?: any; applyPasswordPolicy?: boolean; + tenantIdForPasswordPolicy?: string; }): Promise< | { status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR"; diff --git a/lib/build/recipe/thirdpartyemailpassword/index.js b/lib/build/recipe/thirdpartyemailpassword/index.js index c3eca86f7..09c3c4841 100644 --- a/lib/build/recipe/thirdpartyemailpassword/index.js +++ b/lib/build/recipe/thirdpartyemailpassword/index.js @@ -125,9 +125,14 @@ class Wrapper { }); } static updateEmailOrPassword(input) { - return recipe_1.default - .getInstanceOrThrowError() - .recipeInterfaceImpl.updateEmailOrPassword(Object.assign({ userContext: {} }, input)); + return recipe_1.default.getInstanceOrThrowError().recipeInterfaceImpl.updateEmailOrPassword( + Object.assign(Object.assign({ userContext: {} }, input), { + tenantIdForPasswordPolicy: + input.tenantIdForPasswordPolicy === undefined + ? constants_1.DEFAULT_TENANT_ID + : input.tenantIdForPasswordPolicy, + }) + ); } static createResetPasswordLink(userId, tenantId, userContext) { return __awaiter(this, void 0, void 0, function* () { diff --git a/lib/build/recipe/thirdpartyemailpassword/types.d.ts b/lib/build/recipe/thirdpartyemailpassword/types.d.ts index 48df0bb9b..168877371 100644 --- a/lib/build/recipe/thirdpartyemailpassword/types.d.ts +++ b/lib/build/recipe/thirdpartyemailpassword/types.d.ts @@ -204,6 +204,7 @@ export declare type RecipeInterface = { password?: string; userContext: any; applyPasswordPolicy?: boolean; + tenantIdForPasswordPolicy: string; }): Promise< | { status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR"; diff --git a/lib/build/recipe/thirdpartyemailpassword/utils.js b/lib/build/recipe/thirdpartyemailpassword/utils.js index 797bd9b35..5c70f616d 100644 --- a/lib/build/recipe/thirdpartyemailpassword/utils.js +++ b/lib/build/recipe/thirdpartyemailpassword/utils.js @@ -44,7 +44,7 @@ function validateAndNormaliseUserInput(recipeInstance, appInfo, config) { : _a.service; /** * following code is for backward compatibility. - * if user has not passed emailDelivery config, we use the default + * if user has not passed emailService config, we use the default * createAndSendEmailUsingSupertokensService implementation */ if (emailService === undefined) { diff --git a/lib/build/recipe/thirdpartypasswordless/utils.js b/lib/build/recipe/thirdpartypasswordless/utils.js index fea21a20f..a770c6acb 100644 --- a/lib/build/recipe/thirdpartypasswordless/utils.js +++ b/lib/build/recipe/thirdpartypasswordless/utils.js @@ -39,7 +39,7 @@ function validateAndNormaliseUserInput(appInfo, config) { : _a.service; /** * following code is for backward compatibility. - * if user has not passed emailDelivery config, we use the default + * if user has not passed emailService config, we use the default * createAndSendEmailUsingSupertokensService implementation */ if (emailService === undefined) { diff --git a/lib/ts/recipe/thirdpartyemailpassword/index.ts b/lib/ts/recipe/thirdpartyemailpassword/index.ts index 0e7b9552a..283aab59d 100644 --- a/lib/ts/recipe/thirdpartyemailpassword/index.ts +++ b/lib/ts/recipe/thirdpartyemailpassword/index.ts @@ -123,10 +123,13 @@ export default class Wrapper { password?: string; userContext?: any; applyPasswordPolicy?: boolean; + tenantIdForPasswordPolicy?: string; }) { return Recipe.getInstanceOrThrowError().recipeInterfaceImpl.updateEmailOrPassword({ userContext: {}, ...input, + tenantIdForPasswordPolicy: + input.tenantIdForPasswordPolicy === undefined ? DEFAULT_TENANT_ID : input.tenantIdForPasswordPolicy, }); } diff --git a/lib/ts/recipe/thirdpartyemailpassword/types.ts b/lib/ts/recipe/thirdpartyemailpassword/types.ts index 988465a44..5f62c9665 100644 --- a/lib/ts/recipe/thirdpartyemailpassword/types.ts +++ b/lib/ts/recipe/thirdpartyemailpassword/types.ts @@ -190,6 +190,7 @@ export type RecipeInterface = { password?: string; userContext: any; applyPasswordPolicy?: boolean; + tenantIdForPasswordPolicy: string; }): Promise< | { status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR";