remove old stuff

This commit is contained in:
counterweight 2025-02-13 00:07:15 +01:00
parent 1a7681a908
commit 9088e9f9c6
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C

View file

@ -1,31 +0,0 @@
async function login() {
if (!window.nostr) {
console.log("No Nostr extension found.");
return { success: false, error: "No Nostr extension detected." };
}
try {
const challengeResponse = await fetch("/api/nostr-challenge");
if (!challengeResponse.ok) throw new Error("Failed to fetch challenge");
const { challenge } = await challengeResponse.json();
const pubkey = await window.nostr.getPublicKey();
const event = {
kind: 22242,
created_at: Math.floor(Date.now() / 1000),
tags: [["challenge", challenge]],
content: "Sign this challenge to authenticate",
pubkey: pubkey
};
const signedEvent = await window.nostr.signEvent(event);
const verifyResponse = await fetch("/api/nostr-verify", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(signedEvent),
});
} catch (error) { }
}