Affected area
API keys
Summary
The Dashboard uses Better Auth's apiKey() plugin for API key management, but this plugin's database schema is incompatible with Knowhere API's native API Key system. This causes critical auth failures when users try to use API keys generated in the Dashboard.
Problems:
- Better Auth apiKey plugin creates a different schema than expected by Knowhere API
- API keys created in Dashboard cannot be used to authenticate API requests
- Users see "Unauthorized" errors despite creating valid API keys
- The two systems cannot share or validate the same API keys
Root Cause:
In lib/auth.ts, the Better Auth configuration includes:
plugins: [ jwt(), apiKey(), magicLink() ]
But the generated schema doesn't match Knowhere API's api_keys table structure (SHA-256 hashed keys with user_id, key_mask, etc.).
Browser
Chrome
Reproduction steps
/
Screenshots or recordings
No response
Relevant logs
Affected area
API keys
Summary
The Dashboard uses Better Auth's
apiKey()plugin for API key management, but this plugin's database schema is incompatible with Knowhere API's native API Key system. This causes critical auth failures when users try to use API keys generated in the Dashboard.Problems:
Root Cause:
In
lib/auth.ts, the Better Auth configuration includes:But the generated schema doesn't match Knowhere API's
api_keystable structure (SHA-256 hashed keys withuser_id,key_mask, etc.).Browser
Chrome
Reproduction steps
/
Screenshots or recordings
No response
Relevant logs