Merge pull request #2969 from Infisical/misc/fix-shared-secret-within-org-and-login-redirect

misc: resolve shared secret within org and added login redirect
This commit is contained in:
Sheen
2025-01-11 02:16:48 +08:00
committed by GitHub
5 changed files with 79 additions and 7 deletions
@@ -206,8 +206,13 @@ export const secretSharingServiceFactory = ({
const orgName = sharedSecret.orgId ? (await orgDAL.findOrgById(sharedSecret.orgId))?.name : "";
if (accessType === SecretSharingAccessType.Organization && orgId !== sharedSecret.orgId)
if (accessType === SecretSharingAccessType.Organization && orgId === undefined) {
throw new UnauthorizedError();
}
if (accessType === SecretSharingAccessType.Organization && orgId !== sharedSecret.orgId) {
throw new ForbiddenRequestError();
}
// all secrets pass through here, meaning we check if its expired first and then check if it needs verification
// or can be safely sent to the client.