SHARE
TWEET

Untitled

a guest Aug 23rd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $('#up').on('click', function(e) {
  2.         e.preventDefault();
  3.         let aliasIn = $('#alias').val()
  4.         let passIn = $('#pass').val()
  5.         gun.get("~@" + aliasIn).once(function (uAlias) {
  6.             if (uAlias === undefined) {
  7.                 console.log("alias undefined, registering.")
  8.                 user.create($('#alias').val(), $('#pass').val(), function (ack) {
  9.                     console.log("create user ack: " + ack)
  10.                     user.auth($('#alias').val(), $('#pass').val());
  11.                 });
  12.             } else {
  13.                 console.log("Error: User " + alias + " already exists. Cannot register.")
  14.             }
  15.         })
  16.     })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top