From cd93226ea1f37b1e3023bed747a33e619fc62514 Mon Sep 17 00:00:00 2001 From: Bas van den Aakster Date: Wed, 10 Dec 2025 22:07:26 +0100 Subject: [PATCH] Update demo for unified Ed25519 authentication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove all credential storage from localStorage - Remove 'register' setup step (now: init → claim → ready) - Update initialization to work without credentials - Simplify localStorage to only username and keypair - Anonymous users auto-claim during initialize() - Named users manually claim username localStorage keys: - Keep: rondevu-username, rondevu-keypair, rondevu-contacts - Remove: rondevu-chat-credentials Setup flow: - Load username/keypair from localStorage - Create Rondevu instance (auto-generates anon username if none saved) - Call initialize() (no register call) - Check if username claimed - Show claim UI if needed, or proceed to ready --- src/App.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/App.jsx b/src/App.jsx index 63d23ef..0867c27 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -164,15 +164,18 @@ export default function App() { const parsedKeypair = savedKeypair ? JSON.parse(savedKeypair) : undefined; + // Create Rondevu instance + // If no username is saved, use undefined to let Rondevu handle it const service = new Rondevu({ apiUrl: API_URL, - username: savedUsername || 'temp', + username: savedUsername, keypair: parsedKeypair, }); await service.initialize(); setRondevu(service); + // Check if we have a saved username and if it's claimed if (savedUsername && savedKeypair) { console.log('[Init] Checking if username is claimed...'); const isClaimed = await service.isUsernameClaimed(); @@ -187,6 +190,7 @@ export default function App() { setSetupStep('claim'); } } else { + // No saved username, prompt user to claim one setSetupStep('claim'); } } catch (err) {