From c2227ef1ec60a32fbc7f2117ce64ba092368cc4d Mon Sep 17 00:00:00 2001 From: Mihaly Lengyel Date: Thu, 21 Sep 2023 11:38:23 +0200 Subject: [PATCH] fix: add tenant id into password reset links --- .../recipe/emailpassword/api/implementation.js | 14 +++++++------- lib/ts/recipe/emailpassword/api/implementation.ts | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/build/recipe/emailpassword/api/implementation.js b/lib/build/recipe/emailpassword/api/implementation.js index 06fd3603e..fcaf413cd 100644 --- a/lib/build/recipe/emailpassword/api/implementation.js +++ b/lib/build/recipe/emailpassword/api/implementation.js @@ -11,6 +11,7 @@ const __1 = require("../../../"); const recipe_1 = __importDefault(require("../../accountlinking/recipe")); const recipe_2 = __importDefault(require("../../emailverification/recipe")); const recipeUserId_1 = __importDefault(require("../../../recipeUserId")); +const utils_1 = require("../utils"); function getAPIImplementation() { return { emailExistsGET: async function ({ email, tenantId }) { @@ -57,13 +58,12 @@ function getAPIImplementation() { status: "OK", }; } - let passwordResetLink = - options.appInfo.websiteDomain.getAsStringDangerous() + - options.appInfo.websiteBasePath.getAsStringDangerous() + - "/reset-password?token=" + - response.token + - "&rid=" + - options.recipeId; + let passwordResetLink = utils_1.getPasswordResetLink({ + appInfo: options.appInfo, + token: response.token, + recipeId: options.recipeId, + tenantId, + }); logger_1.logDebugMessage(`Sending password reset email to ${email}`); await options.emailDelivery.ingredientInterfaceImpl.sendEmail({ tenantId, diff --git a/lib/ts/recipe/emailpassword/api/implementation.ts b/lib/ts/recipe/emailpassword/api/implementation.ts index f8b4f0e2d..50fcdf5a9 100644 --- a/lib/ts/recipe/emailpassword/api/implementation.ts +++ b/lib/ts/recipe/emailpassword/api/implementation.ts @@ -8,6 +8,7 @@ import AccountLinking from "../../accountlinking/recipe"; import EmailVerification from "../../emailverification/recipe"; import { RecipeLevelUser } from "../../accountlinking/types"; import RecipeUserId from "../../../recipeUserId"; +import { getPasswordResetLink } from "../utils"; export default function getAPIImplementation(): APIInterface { return { @@ -100,13 +101,12 @@ export default function getAPIImplementation(): APIInterface { }; } - let passwordResetLink = - options.appInfo.websiteDomain.getAsStringDangerous() + - options.appInfo.websiteBasePath.getAsStringDangerous() + - "/reset-password?token=" + - response.token + - "&rid=" + - options.recipeId; + let passwordResetLink = getPasswordResetLink({ + appInfo: options.appInfo, + token: response.token, + recipeId: options.recipeId, + tenantId, + }); logDebugMessage(`Sending password reset email to ${email}`); await options.emailDelivery.ingredientInterfaceImpl.sendEmail({