api: switch license endpoint to POST/JSON, fix active check, add key copy button

- Change /api/v1/license from GET with query params to POST with JSON body
- Request body uses license_key and email_address
- Response returns key, email_address, subscription_level
- Add active check (reject deactivated license keys)
- Exclude /api/v1/automations/ from API key auth (GHL webhook)
- Add copyableFields prop to AdminTable with clipboard icon
- Enable copy button on license key field in license-keys admin page
This commit is contained in:
NeilClack
2026-07-08 14:11:01 -05:00
parent 46b2cdf53d
commit 4d21288511
4 changed files with 58 additions and 19 deletions
+4 -1
View File
@@ -4,7 +4,10 @@ import { building } from '$app/environment';
import { validateApiKey } from '$lib/server/api-key';
export async function handle({ event, resolve }) {
if (event.url.pathname.startsWith('/api/v1/')) {
if (
event.url.pathname.startsWith('/api/v1/') &&
!event.url.pathname.startsWith('/api/v1/automations/')
) {
const authHeader = event.request.headers.get('authorization');
if (!authHeader?.startsWith('Bearer ')) {
return new Response(JSON.stringify({ error: 'API key required' }), {