remove old stuff
This commit is contained in:
parent
fb9832fabb
commit
d4f01ea843
4 changed files with 2 additions and 198 deletions
|
|
@ -28,59 +28,4 @@ async function login() {
|
|||
});
|
||||
|
||||
} catch (error) { }
|
||||
/*
|
||||
|
||||
if (!verifyResponse.ok) throw new Error("Verification failed");
|
||||
const verifyResult = await verifyResponse.json();
|
||||
|
||||
if (verifyResult.success) {
|
||||
console.log("Authentication successful!");
|
||||
return { success: true, pubkey };
|
||||
} else {
|
||||
throw new Error("Invalid signature");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error during Nostr authentication:", error.message);
|
||||
return { success: false, error: error.message };
|
||||
} */
|
||||
}
|
||||
|
||||
/*
|
||||
window.onload = function () {
|
||||
setTimeout(function () {
|
||||
console.log("This code runs 2 seconds after the window has loaded.");
|
||||
const npub = window.nostr.getPublicKey();
|
||||
let pubkeyP = document.querySelector("#pubkey-p");
|
||||
let pubkeySpan = document.querySelector("#pubkey-span");
|
||||
|
||||
npub.then(async function (npub) {
|
||||
console.log(npub);
|
||||
pubkeyP.style.display = "block";
|
||||
pubkeySpan.innerText = npub;
|
||||
|
||||
try {
|
||||
const response = await fetch('/api/session-npubbed', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
"npub": npub
|
||||
})
|
||||
});
|
||||
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
console.log('SessionNpubbed record created successfully:', data);
|
||||
} else {
|
||||
const error = await response.json();
|
||||
console.error('Failed to create sessionNpubbed record:', error);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('An error occurred:', error);
|
||||
}
|
||||
}
|
||||
|
||||
)
|
||||
}, 2000);
|
||||
} */
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue