From d74b819f572e647c01b533a4dd475502458b2705 Mon Sep 17 00:00:00 2001 From: Scott Wilson Date: Tue, 28 Jan 2025 09:53:40 -0800 Subject: [PATCH] improvements: make logged in status disclaimer in email more prominent and only add email auth method if not already present --- .../src/services/auth/auth-password-service.ts | 16 +++++++++------- .../smtp/templates/passwordSetup.handlebars | 3 ++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/backend/src/services/auth/auth-password-service.ts b/backend/src/services/auth/auth-password-service.ts index aef8eafb9..9f004eafc 100644 --- a/backend/src/services/auth/auth-password-service.ts +++ b/backend/src/services/auth/auth-password-service.ts @@ -345,13 +345,15 @@ export const authPaswordServiceFactory = ({ if (!user.isAccepted || !user.authMethods) throw new BadRequestError({ message: `You must complete signup to set a password` }); - await userDAL.updateById( - actor.id, - { - authMethods: [...user.authMethods, AuthMethod.EMAIL] - }, - tx - ); + if (!user.authMethods.includes(AuthMethod.EMAIL)) { + await userDAL.updateById( + actor.id, + { + authMethods: [...user.authMethods, AuthMethod.EMAIL] + }, + tx + ); + } const cfg = getConfig(); diff --git a/backend/src/services/smtp/templates/passwordSetup.handlebars b/backend/src/services/smtp/templates/passwordSetup.handlebars index 1d3a5f72d..1059a7446 100644 --- a/backend/src/services/smtp/templates/passwordSetup.handlebars +++ b/backend/src/services/smtp/templates/passwordSetup.handlebars @@ -6,7 +6,8 @@

Setup your password

-

Someone requested to set up a password for your account. Make sure you are already logged in to Infisical in the current browser before clicking the link below.

+

Someone requested to set up a password for your account.

+

Make sure you are already logged in to Infisical in the current browser before clicking the link below.

Setup password

If you didn't initiate this request, please contact {{#if isCloud}}us immediately at team@infisical.com.{{else}}your administrator immediately.{{/if}}