Add remote key fetch proxy and improve chat reliability

Introduces an API route to proxy remote key bundle fetches, improving CORS handling for secure chat. Updates chat UI to handle error states and retries, enhances key/identity synchronization, and refactors message sending to support remote node domains. Also adds CORS preflight support to the .well-known chat route and improves in-memory key store management.
This commit is contained in:
Christopher
2026-01-27 19:34:37 -08:00
parent 33295b744e
commit 7eae96bc44
6 changed files with 198 additions and 24 deletions
@@ -40,8 +40,18 @@ export async function GET(
return NextResponse.json(response, {
headers: {
'Access-Control-Allow-Origin': '*', // Federation Header
'Cache-Control': 'max-age=60' // Cache for 1 min
'Access-Control-Allow-Origin': '*',
'Cache-Control': 'max-age=60'
}
});
}
export async function OPTIONS() {
return new NextResponse(null, {
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type, Authorization',
},
});
}