nostr:npub1ye5ptcxfyyxl5vjvdjar2ua3f0hynkjzpx552mu5snj3qmx5pzjscpknpr

next.nostrudel.ninja is not responding correctly to a CLOSED "auth-required" message on these three relays, i am just checking this and coracle now auths every time with the auth flow correctly structured according to nip-42 but nostrudel is not sending back an auth unless you open up the task manager and manually click the auth

my suspicion is that the other two relays there are also running teh same flow, so i think your code is not correctly handling... and the naive assumption is that "always" means it always responds with an auth response every time it receives an auth envelope, which it clearly doesn't even with the CLOSED "auth-required" message

would be great if this was fully working to spec

just a side note, i've set up an "auth requested" flag in my websocket library now, so it only ever sends one per websocket connection... previously it was hammering the client with requests for the multiple req envelopes it was receiving, which i don't think is correct either, one socket, one auth, that is how the protocol is described, so i've made it so... i think that if it's done so that each one makes an auth request and each auth request generates a new auth challenge each time there is race conditions, and it's just unnecessary traffic... right answer or silence, is my philosophy

in any case, please alter nostrudel's auth handling so it takes the CLOSED auth-required message as a prompt to auth, as it is specified in nip-42

here is the code that handles CLOSE and NOTICE messages from relays https://github.com/hzrd149/nostrudel/blob/master/src/classes/relay-pool.ts#L218-L224

it will attempt to automatically authenticate but only if the user has "always" selected

however, due to how my subscription logic is structured it will not resend the subscription until its triggered again somewhere else in the app

Reply to this note

Please Login to reply.

Discussion

just to update, i revised the relay protocol flow code and it works consistently now especially with the "proactively auth" option set

so, it was me... thanks for responding though

auth has been a real struggle for nostr this year, and a really important one as it turns out

Auth is very useful, although I'm worried about it becoming the norm and doxing users connections. thats mainly why I have noStrudel set to ask the user every time instead of automatically :)