Add check for user DID before key verification
Throws an error if the user DID is not available before attempting to verify the key on the server, preventing potential runtime errors.
This commit is contained in:
@@ -61,6 +61,9 @@ export function useSodiumChat() {
|
||||
|
||||
// Verify key exists on server
|
||||
console.log('[Sodium] Verifying key on server...');
|
||||
if (!user.did) {
|
||||
throw new Error('User DID not available');
|
||||
}
|
||||
const checkResponse = await fetch(`/api/chat/keys?did=${encodeURIComponent(user.did)}`);
|
||||
|
||||
let shouldPublish = false;
|
||||
|
||||
Reference in New Issue
Block a user