GUIDELINE 01
Make login user-friendly and consistent
Use the network login helpers as the single identity path, and keep credentials and private keys out of browser storage.
Recommended flow
- Load the CDN and finish
itza.init()before enabling the form. - Use
network_signupfor a new account andnetwork_loginfor an existing one. - Show the progress callback; registration may derive wallets and complete proof-of-work.
- Keep the returned keypair in memory only. Show the public address when identity matters.
- Replace technical exceptions with a useful action: retry, sign up, or check the selected network.
Important details
- Usernames may be entered with or without
@. - The same credentials deterministically recover the cluster wallet. A login on another cluster may register its derived cluster wallet.
- Do not use the deprecated
test_loginortest_create_loginaliases in new apps. - Never log passwords, mnemonics, or complete keypairs.
Login and registration
const CLUSTER_ID = 1;
await itza.init(CLUSTER_ID, "dev");
const progress = (message, percent) => {
status.textContent = `${message} · ${percent}%`;
};
async function authenticate(mode, username, password) {
if (!username.trim() || !password) throw new Error("Enter username and password");
const action = mode === "signup" ? itza.network_signup : itza.network_login;
const wallet = await action(username, password, CLUSTER_ID, progress);
console.info("Signed in as", wallet.address); // public address only
return wallet; // keep wallet.keypair in memory
}Bottom line
One form, one selected network and cluster, visible progress, and no persisted credentials produces the least surprising login experience.