mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-09-17 19:13:56 +02:00
feat(kind): using constants
This commit is contained in:
@@ -14,7 +14,7 @@ func CreateUnsignedAuthEvent(challenge, pubkey, relayURL string) nostr.Event {
|
||||
return nostr.Event{
|
||||
PubKey: pubkey,
|
||||
CreatedAt: nostr.Now(),
|
||||
Kind: 22242,
|
||||
Kind: nostr.KindClientAuthentication,
|
||||
Tags: nostr.Tags{
|
||||
nostr.Tag{"relay", relayURL},
|
||||
nostr.Tag{"challenge", challenge},
|
||||
@@ -35,7 +35,7 @@ func parseURL(input string) (*url.URL, error) {
|
||||
// ValidateAuthEvent checks whether event is a valid NIP-42 event for given challenge and relayURL.
|
||||
// The result of the validation is encoded in the ok bool.
|
||||
func ValidateAuthEvent(event *nostr.Event, challenge string, relayURL string) (pubkey string, ok bool) {
|
||||
if event.Kind != 22242 {
|
||||
if event.Kind != nostr.KindClientAuthentication {
|
||||
return "", false
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user