improvements: make logged in status disclaimer in email more prominent and only add email auth method if not already present

This commit is contained in:
Scott Wilson
2025-01-28 09:53:40 -08:00
parent 6af7c5c371
commit d74b819f57
2 changed files with 11 additions and 8 deletions

View File

@@ -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();

View File

@@ -6,7 +6,8 @@
</head>
<body>
<h2>Setup your password</h2>
<p>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.</p>
<p>Someone requested to set up a password for your account.</p>
<p><strong>Make sure you are already logged in to Infisical in the current browser before clicking the link below.</strong></p>
<a href="{{callback_url}}?token={{token}}&to={{email}}">Setup password</a>
<p>If you didn't initiate this request, please contact
{{#if isCloud}}us immediately at team@infisical.com.{{else}}your administrator immediately.{{/if}}</p>