MCPcopy Create free account
hub / github.com/block/buzz / handleAuthChallenge

Method handleAuthChallenge

desktop/src/shared/api/relayClientSession.ts:772–788  ·  view source on GitHub ↗
(challenge: string, generation: number)

Source from the content-addressed store, hash-verified

770 }
771
772 private async handleAuthChallenge(challenge: string, generation: number) {
773 if (!this.relayUrl) {
774 this.relayUrl = await getRelayWsUrl();
775 }
776
777 const event = await createAuthEvent({
778 challenge,
779 relayUrl: this.relayUrl,
780 });
781
782 if (generation !== this.connectionGeneration || !this.authRequest) {
783 return;
784 }
785
786 this.authRequest.pendingEventId = event.id;
787 await this.sendRaw(["AUTH", event]);
788 }
789
790 private handleEvent(subId: string, event: RelayEvent) {
791 const subscription = this.subscriptions.get(subId);

Callers 1

handleWsMessageMethod · 0.95

Calls 3

sendRawMethod · 0.95
getRelayWsUrlFunction · 0.90
createAuthEventFunction · 0.90

Tested by

no test coverage detected