import { MultiFactorAuthenticationMessage } from '../../messages/webMessages/multiFactorAuthenticationMessage';

export const getMultiFactorAuthenticationParams = () => {
  return `
  `;
};

const MULTI_FACTOR_AUTHENTICATION_LISTENERS = {
  verificationTokenCreated: `
    window.addEventListener("${MultiFactorAuthenticationMessage.UNIT_MFA_VERIFICATION_TOKEN_CREATED}", (e) => {
      const response = e.detail
      response.then((data) => {
        postMessageToSDK({ type: "${MultiFactorAuthenticationMessage.UNIT_MFA_VERIFICATION_TOKEN_CREATED}", details: data.data })
      }).catch((e) => {
        console.log(e)
      })
  });
  `
};

export const getMultiFactorAuthenticationScript = () => {
  return `
     ${MULTI_FACTOR_AUTHENTICATION_LISTENERS.verificationTokenCreated}
  `;
};
