mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 07:26:34 +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"
|
message: "No pending invitation found"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const organization = await orgDAL.findById(orgId);
|
||||||
|
|
||||||
await tokenService.validateTokenForUser({
|
await tokenService.validateTokenForUser({
|
||||||
type: TokenType.TOKEN_EMAIL_ORG_INVITATION,
|
type: TokenType.TOKEN_EMAIL_ORG_INVITATION,
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
@@ -1296,6 +1298,13 @@ export const orgServiceFactory = ({
|
|||||||
return { user };
|
return { user };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
organization.authEnforced &&
|
||||||
|
!(organization.bypassOrgAuthEnabled && orgMembership.role === OrgMembershipRole.Admin)
|
||||||
|
) {
|
||||||
|
return { user };
|
||||||
|
}
|
||||||
|
|
||||||
const appCfg = getConfig();
|
const appCfg = getConfig();
|
||||||
const token = jwt.sign(
|
const token = jwt.sign(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user