a87977241c
Replaces legacy chat encryption modules with new sodium-based implementation. Adds and updates API routes for chat key management and debugging, introduces new hooks and scripts for sodium chat, and updates related database schema and configuration. Removes old crypto modules and updates dependencies accordingly.
19 lines
585 B
TypeScript
19 lines
585 B
TypeScript
import { NextResponse } from 'next/server';
|
|
import { db } from '@/db';
|
|
import { chatDeviceBundles } from '@/db/schema';
|
|
|
|
export async function POST() {
|
|
try {
|
|
console.log('[Debug] Clearing all chat device bundles...');
|
|
|
|
await db.delete(chatDeviceBundles);
|
|
|
|
console.log('[Debug] Cleared all chat device bundles');
|
|
|
|
return NextResponse.json({ success: true, message: 'Cleared all chat keys' });
|
|
} catch (error: any) {
|
|
console.error('[Debug] Failed to clear keys:', error);
|
|
return NextResponse.json({ error: error.message }, { status: 500 });
|
|
}
|
|
}
|