<style> div.pInf, div.brdCmb, h1.pTtl, .hot-items-buttons, header.header, .blogMn { display: none !important; } </style> <br /> <br /> <div id='div_1' style="display: none; text-align: center;"> <h1 id='logs'>You have successfully confirmed your account and is now active! Thank you!</h1> <img src="https://mystickermania.com/cdn/stickers/games/the-battle-cats-nerd-cat-512x512.png" /> <button class="ui red button" onclick="window.location.href="https://storehaccountsdummy22.blogspot.com""> Go Back Home </button> </div> <script type='module'> // at this case we might want to create a record in the database window.addEventListener('load', async () => { await initFunctions['supabase']; let userdata = await supabase.auth.getUser(); let session_data = await supabase.auth.getSession(); let logs = document.querySelector('#logs'); let divparent = document.querySelector('#div_1'); let url = window.location.href; url = decodeURIComponent(url); if (localStorage.getItem('signup_user_infos') && userdata.data.user && session_data.data.session && url.includes(session_data.data.session.access_token)) { divparent.style.display = 'block'; // write all the informations and create a record... // email 0 // username 1 // password 2 // password 3 // birthday 4 // country 5 // gender 6 let data = localStorage.getItem('signup_user_infos'); data = JSON.parse(data); data = data.infos; let created_user = await supabase.from('users').insert( { created_at: "now()", username: data[1], gender: data[6], country: data[5], rank_id: 1, email: data[0], birthday: data[4] } ); localStorage.removeItem('signup_user_infos') if (created_user.error) { window.alert('There has been an error while creating your account! ' + JSON.stringify(created_user.error)); return; } window.alert("You're account has been verified. Thank you!"); } else window.location.href = 'https://storehaccountsdummy22.blogspot.com/p/create-account.html'; }, false); </script>