mirror of
https://github.com/xtr-dev/rondevu-demo.git
synced 2025-12-13 03:53:22 +00:00
Update demo for unified Ed25519 authentication
- 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
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user