feat: respond with challenge to client AUTH message

This commit is contained in:
Vlad Stan 2023-02-15 11:44:35 +02:00
parent 9aa0fdbd2c
commit 88d53bd73d

View file

@ -158,7 +158,7 @@ class NostrClientConnection:
if message_type == NostrEventType.CLOSE: if message_type == NostrEventType.CLOSE:
self._handle_close(data[1]) self._handle_close(data[1])
if message_type == NostrEventType.AUTH: if message_type == NostrEventType.AUTH:
self._handle_auth(data[1]) await self._handle_auth(data[1])
return [] return []
@ -257,8 +257,8 @@ class NostrClientConnection:
def _handle_close(self, subscription_id: str): def _handle_close(self, subscription_id: str):
self._remove_filter(subscription_id) self._remove_filter(subscription_id)
def _handle_auth(self): async def _handle_auth(self):
raise ValueError("Not supported") await self._send_msg(["AUTH", self._current_auth_challenge()])
def _can_add_filter(self) -> bool: def _can_add_filter(self) -> bool:
return ( return (