Skip to content

Commit

Permalink
Hide internal errors in SAML Fed request path
Browse files Browse the repository at this point in the history
  • Loading branch information
niwsa committed Jan 22, 2025
1 parent f2f399c commit 0fecc96
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions npm/src/ee/identity-federation/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {
AppRequestParams,
Index,
} from '../../typings';
import { fedAppID, clientIDFederatedPrefix } from '../../controller/utils';
import { fedAppID, clientIDFederatedPrefix, GENERIC_ERR_STRING } from '../../controller/utils';
import { JacksonError } from '../../controller/error';
import { getDefaultCertificate } from '../../saml/x509';
import { IndexNames, validateTenantAndProduct } from '../../controller/utils';
Expand Down Expand Up @@ -377,7 +377,11 @@ export class App {
await throwIfInvalidLicense(this.opts.boxyhqLicenseKey);

if (!entityId) {
throw new JacksonError('Missing required parameters. Required parameters are: entityId', 400);
throw new JacksonError(
GENERIC_ERR_STRING,
400,
'Missing required parameters. Required parameters are: entityId'
);
}

const apps: IdentityFederationApp[] = (
Expand All @@ -388,7 +392,7 @@ export class App {
).data;

if (!apps || apps.length === 0) {
throw new JacksonError('Identity Federation app not found', 404);
throw new JacksonError(GENERIC_ERR_STRING, 404, 'Identity Federation app not found');
}

return apps[0];
Expand Down

0 comments on commit 0fecc96

Please sign in to comment.