mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 22:51:53 +00:00
Patch new org creation condition on SAML account signup, enable users to toggle auth methods regardless of what org they are in
This commit is contained in:
@@ -30,15 +30,6 @@ export const userServiceFactory = ({ userDAL }: TUserServiceFactoryDep) => {
|
||||
const user = await userDAL.findById(userId);
|
||||
if (!user) throw new BadRequestError({ name: "Update auth methods" });
|
||||
|
||||
const hasSamlEnabled = user?.authMethods?.some((method) =>
|
||||
[AuthMethod.OKTA_SAML, AuthMethod.AZURE_SAML, AuthMethod.JUMPCLOUD_SAML].includes(method as AuthMethod)
|
||||
);
|
||||
if (hasSamlEnabled)
|
||||
throw new BadRequestError({
|
||||
name: "Update auth method",
|
||||
message: "Failed to update auth methods due to SAML SSO "
|
||||
});
|
||||
|
||||
const updatedUser = await userDAL.updateById(userId, { authMethods });
|
||||
return updatedUser;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user