mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 23:26:42 +00:00
Fix scim user updates setting isEmailVerified back to false when the email has not changed
This commit is contained in:
@@ -579,6 +579,9 @@ export const scimServiceFactory = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const serverCfg = await getServerCfg();
|
const serverCfg = await getServerCfg();
|
||||||
|
const hasEmailChanged = email?.toLowerCase() !== membership.email;
|
||||||
|
const defaultEmailVerified =
|
||||||
|
org.orgAuthMethod === OrgAuthMethod.OIDC ? serverCfg.trustOidcEmails : serverCfg.trustSamlEmails;
|
||||||
await userDAL.transaction(async (tx) => {
|
await userDAL.transaction(async (tx) => {
|
||||||
await userAliasDAL.update(
|
await userAliasDAL.update(
|
||||||
{
|
{
|
||||||
@@ -605,8 +608,7 @@ export const scimServiceFactory = ({
|
|||||||
firstName,
|
firstName,
|
||||||
email: email?.toLowerCase(),
|
email: email?.toLowerCase(),
|
||||||
lastName,
|
lastName,
|
||||||
isEmailVerified:
|
isEmailVerified: hasEmailChanged ? defaultEmailVerified : undefined
|
||||||
org.orgAuthMethod === OrgAuthMethod.OIDC ? serverCfg.trustOidcEmails : serverCfg.trustSamlEmails
|
|
||||||
},
|
},
|
||||||
tx
|
tx
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user