mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Merge pull request #4101 from Infisical/fix/authEnforcedMemberInviteCheck
Fix authEnforced returning a token when org has authEnforced enabled
This commit is contained in:
@@ -1274,6 +1274,8 @@ export const orgServiceFactory = ({
|
||||
message: "No pending invitation found"
|
||||
});
|
||||
|
||||
const organization = await orgDAL.findById(orgId);
|
||||
|
||||
await tokenService.validateTokenForUser({
|
||||
type: TokenType.TOKEN_EMAIL_ORG_INVITATION,
|
||||
userId: user.id,
|
||||
@@ -1296,6 +1298,13 @@ export const orgServiceFactory = ({
|
||||
return { user };
|
||||
}
|
||||
|
||||
if (
|
||||
organization.authEnforced &&
|
||||
!(organization.bypassOrgAuthEnabled && orgMembership.role === OrgMembershipRole.Admin)
|
||||
) {
|
||||
return { user };
|
||||
}
|
||||
|
||||
const appCfg = getConfig();
|
||||
const token = jwt.sign(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user