better logging for sdk auth

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-04-12 20:50:17 +02:00
parent 8d55f6b30d
commit 8485618726
3 changed files with 10 additions and 8 deletions

View File

@@ -23,11 +23,6 @@ export async function validateSdkRequest(
const clientSecret = clientSecretNew || clientSecretOld;
const origin = headers.origin;
// Temp log
logger.info(
{ clientId, origin: origin ? origin : 'empty' },
'validateSdkRequest'
);
if (!clientId) {
throw new Error('Ingestion: Missing client id');
@@ -69,7 +64,12 @@ export async function validateSdkRequest(
}
}
throw new Error('Ingestion: Invalid client secret');
logger.error({
client,
headers,
origin,
});
throw new Error('Ingestion: Invalid cors or secret');
}
export async function validateExportRequest(