Don't encrypt settings_store

This commit is contained in:
Alex Gleason 2024-05-26 12:34:18 -05:00
parent d6727d2d09
commit a66df583fb
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 6 additions and 3 deletions

View File

@ -66,8 +66,11 @@ const verifyCredentialsController: AppController = async (c) => {
: await accountFromPubkey(pubkey, { withSource: true }); : await accountFromPubkey(pubkey, { withSource: true });
if (settingsStore) { if (settingsStore) {
const data = await signer.nip44!.decrypt(pubkey, settingsStore.content); try {
account.pleroma.settings_store = JSON.parse(data); account.pleroma.settings_store = JSON.parse(settingsStore.content);
} catch {
// Ignore
}
} }
return c.json(account); return c.json(account);
@ -288,7 +291,7 @@ const updateCredentialsController: AppController = async (c) => {
await createEvent({ await createEvent({
kind: 30078, kind: 30078,
tags: [['d', 'pub.ditto.pleroma_settings_store']], tags: [['d', 'pub.ditto.pleroma_settings_store']],
content: await signer.nip44!.encrypt(pubkey, JSON.stringify(settingsStore)), content: JSON.stringify(settingsStore),
}, c); }, c);
} }