mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-23 03:25:07 +03:00
Implement Signal Protocol
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user