/** * Custom API key auth against Verae middleware. * @module authentication */ const middlewareBase = () => process.env.MIDDLEWARE_BASE_URL || 'http://127.0.0.1:3100'; /** * Zapier connection test — validates API key. * @param {object} z * @param {object} bundle */ const testAuth = async (z, bundle) => { const response = await z.request({ url: `${middlewareBase()}/zapier/v1/auth/me`, headers: { Authorization: `Bearer ${bundle.authData.api_key}`, }, }); return response.data; }; module.exports = { type: 'custom', fields: [ { key: 'api_key', type: 'string', required: true, label: 'API Key', helpText: 'Your Verae API key (zmw_…) from signup or admin provisioning.', }, ], test: testAuth, connectionLabel: '{{tenantId}} ({{plan}})', };