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.
20 lines
651 B
TypeScript
20 lines
651 B
TypeScript
import { NextResponse } from 'next/server';
|
|
import { db } from '@/db';
|
|
import { chatDeviceBundles } from '@/db/schema';
|
|
|
|
export async function GET() {
|
|
try {
|
|
const bundles = await db.select({
|
|
did: chatDeviceBundles.did,
|
|
userId: chatDeviceBundles.userId,
|
|
deviceId: chatDeviceBundles.deviceId,
|
|
identityKey: chatDeviceBundles.identityKey,
|
|
createdAt: chatDeviceBundles.createdAt,
|
|
}).from(chatDeviceBundles).orderBy(chatDeviceBundles.createdAt);
|
|
|
|
return NextResponse.json({ bundles, count: bundles.length });
|
|
} catch (error: any) {
|
|
return NextResponse.json({ error: error.message }, { status: 500 });
|
|
}
|
|
}
|