Update packages/stack-shared/src/schema-fields.ts

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
This commit is contained in:
Zai Shi 2025-05-21 00:43:46 +02:00 committed by GitHub
parent 2191e1c023
commit 30b4d0016b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -482,7 +482,6 @@ export const basicAuthorizationHeaderSchema = yupString().test('is-basic-authori
// Neon integration
export const neonAuthorizationHeaderSchema = basicAuthorizationHeaderSchema.test('is-neon-authorization-header', 'Invalid client_id:client_secret values; did you use the correct values for the Neon integration?', (value) => {
if (!value) return true;
console.log("????????????", value, decodeBasicAuthorizationHeader(value));
const [clientId, clientSecret] = decodeBasicAuthorizationHeader(value) ?? throwErr(`Neon authz header invalid? This should've been validated by basicAuthorizationHeaderSchema: ${value}`);
for (const neonClientConfig of JSON.parse(process.env.STACK_INTEGRATION_CLIENTS_CONFIG || '[]')) {
if (clientId === neonClientConfig.client_id && clientSecret === neonClientConfig.client_secret) return true;