Add encrypted key support for chat and nodes
Introduces encrypted private key storage for nodes and users, updates chat message schema to support sender-side encryption, and adds supporting libraries and tests for cryptographic signing and identity unlock flows. Includes new database migrations, API route updates, and React components for identity unlock prompts.
This commit is contained in:
@@ -37,6 +37,9 @@ export async function POST(request: Request) {
|
||||
id: user.id,
|
||||
handle: user.handle,
|
||||
displayName: user.displayName,
|
||||
did: user.did,
|
||||
publicKey: user.publicKey,
|
||||
privateKeyEncrypted: user.privateKeyEncrypted, // Client will decrypt with password
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
@@ -33,6 +33,9 @@ export async function GET() {
|
||||
avatarUrl: session.user.avatarUrl,
|
||||
bio: session.user.bio,
|
||||
website: session.user.website,
|
||||
did: session.user.did,
|
||||
publicKey: session.user.publicKey,
|
||||
privateKeyEncrypted: session.user.privateKeyEncrypted,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
@@ -68,6 +68,9 @@ export async function POST(request: Request) {
|
||||
id: user.id,
|
||||
handle: user.handle,
|
||||
displayName: user.displayName,
|
||||
did: user.did,
|
||||
publicKey: user.publicKey,
|
||||
privateKeyEncrypted: user.privateKeyEncrypted, // Client will decrypt with password
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user