Testing auth

This commit is contained in:
Vitor Pamplona 2024-01-28 14:10:55 -05:00
parent 967d29ef2f
commit 3297f9d501
2 changed files with 4 additions and 7 deletions

View File

@ -62,7 +62,7 @@
type="text"
id="relaySet"
name="relaySet"
placeholder="wss://nos.lol"
placeholder="Force relays or blank to use your list: wss://nos.lol"
style="width: 180px"
value="" />
</p>

View File

@ -420,13 +420,8 @@ function sha256Hex(string) {
async function signNostrAuthEvent(relay, auth_challenge) {
try {
if (!window.nostr) {
throw "Nostr extension not loaded or available"
}
let msg = {
kind: 22243, // NIP-42++
kind: 22243,
content: "",
tags: [
["relay", relay],
@ -434,6 +429,8 @@ async function signNostrAuthEvent(relay, auth_challenge) {
],
};
console.log(msg)
// set msg fields
msg.created_at = Math.floor((new Date()).getTime() / 1000);
msg.pubkey = await window.nostr.getPublicKey();