Skip to content

Instantly share code, notes, and snippets.

@vlzhr
Created December 25, 2019 23:37
Show Gist options
  • Save vlzhr/1d919020bf5ff02b447858caf97f8bd0 to your computer and use it in GitHub Desktop.
Save vlzhr/1d919020bf5ff02b447858caf97f8bd0 to your computer and use it in GitHub Desktop.
document.querySelector(".js-login").addEventListener("click", async function(event) {
try {
const userData = await waves.login(); // calling Waves Signer
event.target.classList.add("clicked");
event.target.innerHTML = `
authorized as <br>
${userData.address}`; // getting account address
} catch (e) {
console.error('login rejected') // handling user auth reject
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment