diff --git a/apps/identity.json b/apps/identity.json index 4f2a7b1d..cbae76b4 100644 --- a/apps/identity.json +++ b/apps/identity.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🪪", - "previous": "&zxsmzdLKsiG/WZt/Gw7JOxepgypoktNNbIyWiyFiJVc=.sha256" + "previous": "&5kw/2PgcySwOYCmAkjHTR2xTkIx3i7UjQmtQ8MfgWw8=.sha256" } diff --git a/apps/identity/app.js b/apps/identity/app.js index 6b0eedf7..e45c32d1 100644 --- a/apps/identity/app.js +++ b/apps/identity/app.js @@ -1,5 +1,7 @@ import * as tfrpc from '/tfrpc.js'; +const is_admin = core.user?.credentials?.permissions?.administration; + tfrpc.register(async function get_private_key(id) { return bip39Words(await ssb.getPrivateKey(id)); }); @@ -15,6 +17,9 @@ tfrpc.register(async function delete_id(id) { tfrpc.register(async function reload() { await main(); }); +tfrpc.register(async function make_server(id) { + return await ssb.swapWithServerIdentity(id); +}); async function main() { let ids = await ssb.getIdentities(); @@ -99,6 +104,16 @@ async function main() { alert('Error deleting ID: ' + e); } } + handler.make_server = async function make_server(event) { + let id = event.srcElement.dataset.id; + try { + if (confirm('Are you sure you want to make "' + id + '" the server identity?\\n\\nFor it to take effect, you will need to both sign in again and restart Tilde Friends.')) { + await tfrpc.rpc.make_server(id); + } + } catch (e) { + alert('Error making server ID: ' + e); + } + }

SSB Identity Management

@@ -117,13 +132,14 @@ async function main() {

Identities