diff --git a/public/join-now.js b/public/join-now.js index 3d60542..9f6daa9 100644 --- a/public/join-now.js +++ b/public/join-now.js @@ -77,6 +77,22 @@ fetch('/api/public/config').then(function(r){return r.json()}).then(function(c){ } var lastBal=null; + // One free signature straight after the join, while the wallet is still connected: + // it opens their inbox session so the member-profile gate can ask for a username + // and email on the dashboard. Best-effort — if they decline, the join still stands + // and they are asked again the first time they sign in. + async function signInNewMember(newId){ + try{ + $('resultSub').innerHTML='Welcome to the team! One free signature sets up your member profile…'; + var ch=await (await fetch('/api/public/msg-challenge',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({address:account})})).json(); + if(!ch||!ch.message) return; + var hex='0x'; for(var i=0,b=new TextEncoder().encode(ch.message);i#'+newId+'. Redirecting to your dashboard…','ok'); try{ el_scroll('result'); }catch(e){} try{sessionStorage.setItem('rmc.fresh','1');}catch(e){} + signInNewMember(newId); setTimeout(function(){ location.href='/my/'+newId; }, 4500); } else { log('Confirmed on-chain. Open your dashboard at /my and enter your new ID (also shown on Polygonscan).','ok');