window.onload = function() {
const statusDiv = document.getElementById(‘status’);
if (typeof Pi === ‘undefined’) {
statusDiv.innerHTML = “Erreur : Le SDK Pi n’est pas chargé.”;
return;
}
statusDiv.innerText = “Initialisation…”;
Pi.init({ version: “2.0”, sandbox: true, appId: “icBCLnYpg0bdpD_Qxfbsms6VRbe8P6J9gA6JjHP5PLk” });
Pi.authenticate([‘username’, ‘payments’], () => {}).then(auth => {
window.location.replace(‘https://core-nodes.com/dashboard/?pi_auth=1&username=’ + encodeURIComponent(auth.user.username));
}).catch(err => {
statusDiv.innerText = “Erreur Auth : ” + err.message;
});
};