Implement Signal Protocol

This commit is contained in:
2025-11-19 16:01:25 +03:00
Unverified
parent 8bda2220c6
commit d4b1e261d7
19 changed files with 1352 additions and 444 deletions
+10
View File
@@ -92,6 +92,16 @@ export function LoginForm({ onSwitchMode }: LoginFormProps) {
try {
await api.user.auth.ensureKeysOnLogin(password, data.token);
// Initialize Signal Protocol after keys are set up
if (data.user?.id) {
const { SignalProtocolService } = await import("@/utils/crypto/signalProtocol");
const { uploadPreKeyBundle } = await import("@/core/api/crypto");
const signalService = new SignalProtocolService(data.user.id.toString());
await signalService.initialize();
const bundle = await signalService.getPreKeyBundle();
await uploadPreKeyBundle(bundle, data.token);
}
} catch (e) {
console.error("Key setup failed:", e);
}