Improve auth buffering policy

This commit is contained in:
Jon Staab
2025-04-02 14:38:02 -07:00
parent ed834954b9
commit 357bcd4366
3 changed files with 59 additions and 105 deletions
+8 -4
View File
@@ -66,10 +66,14 @@ export class AuthState extends EventEmitter {
if (isRelayAuth(message)) {
const [_, challenge] = message
this.challenge = challenge
this.request = undefined
this.details = undefined
this.setStatus(AuthStatus.Requested)
// Sometimes relays send the same challenge multiple times, no need to
// respond to it twice
if (challenge !== this.challenge) {
this.challenge = challenge
this.request = undefined
this.details = undefined
this.setStatus(AuthStatus.Requested)
}
}
}),
on(socket, SocketEvent.Sending, (message: RelayMessage) => {