Add chat page, improve chat API, and remove ChatWidget

Introduces a new chat page with end-to-end encryption, conversation list, and message thread UI. Adds new API endpoints for unread message count and debugging chat keys/messages. Improves chat key validation and reciprocal conversation/message creation for local recipients. Removes the old ChatWidget component. Updates login and chat API logic for better Turnstile and key handling.
This commit is contained in:
Christopher
2026-01-27 01:05:40 -08:00
parent 9739539733
commit 44610157a1
14 changed files with 1168 additions and 573 deletions
+14 -2
View File
@@ -225,9 +225,21 @@ export default function LoginPage() {
try {
const endpoint = mode === 'login' ? '/api/auth/login' : '/api/auth/register';
// Only include turnstileToken if Turnstile is enabled (site key exists)
const body = mode === 'login'
? { email, password, turnstileToken }
: { email, password, handle, displayName, turnstileToken };
? {
email,
password,
...(nodeInfo.turnstileSiteKey ? { turnstileToken } : {})
}
: {
email,
password,
handle,
displayName,
...(nodeInfo.turnstileSiteKey ? { turnstileToken } : {})
};
const res = await fetch(endpoint, {
method: 'POST',