torusresearch / torus-embed

Embeds the Torus Wallet directly in your application via torus-embed. Exposes a Web3 Provider.
https://demo-eth.tor.us
MIT License
84 stars 52 forks source link

Cannot hide twitter verifier #291

Closed nance2uiuc closed 3 years ago

nance2uiuc commented 3 years ago

Describe the bug When initializing, I only want google to appear as a login option. I have set all other verifiers to false (including twitter) but it still appears in the modal.

To Reproduce Steps to reproduce the behavior:

await torus.init({
      network: {
        host: "https://data-seed-prebsc-1-s1.binance.org:8545", // mandatory
        chainId: '97', // optional
        networkName: "Binance Smart Chain- Testnet",
        symbol: "BNB"
      },
      showTorusButton: false, // default: true
      enabledVerifiers: {
        facebook: false,
        google: true,
        facebook: false,
        reddit: false,
        twitch: false,
        discord: false,
        twitter: false
      }
    });

Expected behavior twitter should not appear since it is set to false, but it does.

chaitanyapotti commented 3 years ago

enabledVerifiers is deprecated and not used anymore.

Here's the list of all verifiers

GOOGLE_VERIFIER=google
APPLE_VERIFIER=torus-auth0-apple
DISCORD_VERIFIER=discord
FACEBOOK_VERIFIER=facebook
GITHUB_VERIFIER=torus-auth0-github
KAKAO_VERIFIER=torus-auth0-kakao
LINE_VERIFIER=torus-auth0-line
LINKEDIN_VERIFIER=torus-auth0-linkedin
REDDIT_VERIFIER=reddit
TWITCH_VERIFIER=twitch
TWITTER_VERIFIER=torus-auth0-twitter
WEIBO_VERIFIER=torus-auth0-weibo
WECHAT_VERIFIER=torus-auth0-wechat
HOSTED_EMAIL_PASSWORDLESS_VERIFIER=torus-auth0-email-passwordless

For each of them, you can configure the display using loginConfig

await torus.init({
      network: {
        host: "https://data-seed-prebsc-1-s1.binance.org:8545", // mandatory
        chainId: '97', // optional
        networkName: "Binance Smart Chain- Testnet",
        symbol: "BNB"
      },
      showTorusButton: false, // default: true
      loginConfig: {
        [GOOGLE_VERIFIER]: {
            showOnModal: true, // whether to show or not
            mainOption: true, // big button
            showOnDesktop: true, // desktop only
            showOnMobile: true, // mobile only
          },
        [TWITTER_VERIFIER]: {
            showOnModal: true,
            mainOption: false,
            showOnDesktop: true,
            showOnMobile: true,
        },
        [FACEBOOK_VERIFIER]: {
            showOnModal: false,
            mainOption: false,
            showOnDesktop: false,
            showOnMobile: false,
        }
      }
    });
nance2uiuc commented 3 years ago

Thanks a lot for your help. I read the docs but did not see this. Very helpful!

nance2uiuc commented 3 years ago

For anyone else reading this, it is not enough to copy-past the solution's code.. you must substitute in the key name from the list he provided with added quotes... i.e. [TWITTER_VERIFIER] should become 'torus-auth0-twitter'