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:
+14
-2
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user