diff --git a/web/packages/teleport/src/lib/term/tty.ts b/web/packages/teleport/src/lib/term/tty.ts index 62bbca2f7c22f..85f47c897319d 100644 --- a/web/packages/teleport/src/lib/term/tty.ts +++ b/web/packages/teleport/src/lib/term/tty.ts @@ -94,7 +94,6 @@ class Tty extends EventEmitterMfaSender { ...data.webauthn_response, ...data, }; - console.log({ data }); const encoded = this._proto.encodeChallengeResponse( JSON.stringify(backwardCompatibleData) ); diff --git a/web/packages/teleport/src/lib/useMfa.ts b/web/packages/teleport/src/lib/useMfa.ts index 3c4f552696255..0c40727fab36d 100644 --- a/web/packages/teleport/src/lib/useMfa.ts +++ b/web/packages/teleport/src/lib/useMfa.ts @@ -56,30 +56,23 @@ export function useMfa(emitterSender: EventEmitterMfaSender): MfaState { if (!state.ssoChallenge) { return; } - const channel = new BroadcastChannel(state.ssoChallenge.channelId); function handleMessage(e: MessageEvent<{ mfaToken: string }>) { - if (!state.ssoChallenge) { - return; - } - emitterSender.sendChallengeResponse({ sso_response: { - requestId: state.ssoChallenge.requestId, + requestId: state.ssoChallenge?.requestId, token: e.data.mfaToken, }, }); clearChallenges(); } - channel.addEventListener('message', handleMessage); - return () => { channel.removeEventListener('message', handleMessage); channel.close(); }; - }, [state, emitterSender, state.ssoChallenge]); + }, [state.ssoChallenge, emitterSender]); function onSsoAuthenticate() { if (!state.ssoChallenge) {