[Archive] Getting Error while login in with line

:classical_building: Archived Content from Web3Auth Community

This topic was originally posted by aman.sharma on 5/26/2025.
This content has been migrated from our previous community forum to preserve valuable discussions.


image (25)
image (25)1865Ă—1017 58.6 KB

async function initSNS() {
try {
const chainTestnetConfig = {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: numberToHexadecimal(process.env.NEXT_PUBLIC_CHAINID_ETH),
rpcTarget:
“https://sepolia.infura.io/v3/68026010151145c9b2de3c9889f09067”,
displayName: “Arbitrum Testnet”,
blockExplorer: “”,
ticker: “ETH”,
tickerName: “ETH”,
};
const chainMainnetConfig = {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: numberToHexadecimal(process.env.NEXT_PUBLIC_CHAINID_XANA), // Please use 0x1 for Mainnet
rpcTarget: “https://mainnet.xana.net/rpc”,
displayName: “XANAChain”,
blockExplorer: “https://xanachain.xana.net/”,
ticker: “XETA”,
tickerName: “XANAChain”,
};
const chainConfig =
process.env.NEXT_PUBLIC_NETWORK_TYPE === “testnet”
? chainTestnetConfig
: chainMainnetConfig;
const Testnetid =
// “BMwTnf6I4qw7qwOWP1J1BsgHKEZDGG0peo-DpCMBmurc1RUSY16Ag8LdC4on55hLiStTQxm0FJ2wOuIZU2m9gr0”; //testnet

  "BFgUBN9g6h-PT5NIJo7RdU_05NnXkGZ4b7-H_W2eOGNVtjyWev96SmrwON3MG8bLpI0Oayuw3RziCHWDpZQlYGc"; //testnet
const id = "BN6IUMdXOI0xnRvw6um4CW225E_9DbLhtjnbOGwoL-DkTFUke8IwUehNhlqUHn5JyefNIaWfzr_PLTpF4cmNWbQ"
  // "BPnWnv68o43X4uLNUNrBEWgu6GgletwK5bOU4SLpHFrKrkATivj36lOX3B1DE7u3qeFTksKqK30arrFLYAzAgGY"; //mainnet
const web3auth = new Web3AuthNoModal({
  clientId:
    process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet" ? Testnetid : id,
  chainConfig,
  // web3AuthNetwork: 'testnet', //testnet
  web3AuthNetwork:
    process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet"
      ? "sapphire_devnet"
      : "sapphire_mainnet", //mainnet
  useCoreKitKey: false,
});

const privateKeyProvider:any = new EthereumPrivateKeyProvider({
config: { chainConfig },
});

const openloginAdapter :any= new OpenloginAdapter({
loginSettings: {
mfaLevel: “none”, // Pass on the mfa level of your choice: default, optional, mandatory, none
},
adapterSettings: {
clientId: id,

sessionTime: 86400 * 7,
loginConfig: {
     // Telegram login
     jwt: {
              verifier: "xana-testnet",
              verifierSubIdentifier: "telegram",
              typeOfLogin: "jwt",
              clientId: id,
            },
    //  telegram : {
    //   // verifier: 'ppp-social-login-2', // testnet
    //   verifier:
    //     process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet"
    //       ? "xana-testnet"
    //       : "social-aggregate-verifier", //mainnet
    //   verifierSubIdentifier: "telegram", // Pass the Sub-Verifier here. eg w3a-google
    //   typeOfLogin: "jwt", // Pass the type of login provider.
    //   // clientId: '792163717588-h9t0is3ng39opqmt1meflma087ov18k3.apps.googleusercontent.com', // testnet
    //   // clientId:Testnetid

    //     // process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet"
    //     //   ? "792163717588-h9t0is3ng39opqmt1meflma087ov18k3.apps.googleusercontent.com"
    //     //   : "1041808867611-576ma9t6bva7b94irmvbt88n02tvoujn.apps.googleusercontent.com", //mainnet
    // },
    
  // Google login
  google: {
    // verifier: 'ppp-social-login-2', // testnet
    verifier:
      process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet"
        ? "xana-testnet"
        : "social-aggregate-verifier", //mainnet
    verifierSubIdentifier: "google", // Pass the Sub-Verifier here. eg w3a-google
    typeOfLogin: "google", // Pass the type of login provider.
    // clientId: '792163717588-h9t0is3ng39opqmt1meflma087ov18k3.apps.googleusercontent.com', // testnet
    clientId:
      process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet"
        ? "883163088578-eqsl00u5n7tga1vl4iaf3dp8quq341k8.apps.googleusercontent.com"
        : "1041808867611-576ma9t6bva7b94irmvbt88n02tvoujn.apps.googleusercontent.com", //mainnet
  },
    line: {
                verifier: 'xana-testnet',
                // verifierSubIdentifier: 'ppp-line',
                typeOfLogin: 'jwt',
                clientId: 'yrs3b6Z87XW9c48rJ2UqF3Kz5cLCfO9Z',
            },

// line: {
// verifier: “YOUR_VERIFIER_NAME”, // Verifier name from your Web3Auth dashboard
// typeOfLogin: “jwt”, // Always “jwt” for Auth0
// clientId: “YOUR_AUTH0_CLIENT_ID”, // Auth0 Client ID for your Auth0 application
// },

  apple: {
    // verifier: 'ppp-social-login-2', //testnet
    verifier:
      process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet"
        ? "xana-testnet"
        : "social-aggregate-verifier", //mainnet
    verifierSubIdentifier: "apple",
    typeOfLogin: "jwt",
    // clientId: 'QRQW2fY3167OZTzreWBqHTBQU7gGXUD0', //testnet
    clientId:
      process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet"
        ? "QRQW2fY3167OZTzreWBqHTBQU7gGXUD0"
        : "bJgmFBdg8eSa2gAzh1yv3ABinO9NIq1z", //mainnet
  },
  // emailpasswordless Login via Auth0
  emailpasswordless: {
    verifier:
      process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet"
        ? "xana-testnet"
        : "social-aggregate-verifier", //mainnet                  verifier : "social-aggregate-verifier", //mainnet
    verifierSubIdentifier: "auth0pwdless", // Pass the Sub-Verifier here. eg w3a-a0-email-passwordless
    typeOfLogin: "jwt", // Pass the type of login provider. For Auth0, it's jwt and not Auth0.
    // clientId: 'kV31v4CokK8xEHgNcHki1nAVDCh3Friu', // testnet
    clientId:
      process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet"
        ? "kV31v4CokK8xEHgNcHki1nAVDCh3Friu"
        : "fr46GR3TzfOJFNvgEcIcQKLtLi48cm3c",
  },
},

},
privateKeyProvider,
});
web3auth.configureAdapter(openloginAdapter);
(window as any).Web3Auth = web3auth;
await web3auth.init();
(window as any).Web3AuthProvider = web3auth.provider;

} catch (error) {
console.error(error);
}
}
async function loginWithLine() {
try {
const { Web3Auth } = window as any;
const web3authProvider = await Web3Auth.connectTo(“openlogin”, {
redirectUrl :“http://localhost:3000/mamamia”,
loginProvider: “line”,
extraLoginOptions: {
domain: “https://dev-05dkqxcijmqnze5g.us.auth0.com”, // Pass the Auth0 Domain here, eg. https://web3auth.au.auth0.com

    // This corresponds to the field inside jwt which must be used to uniquely identify the user.
    verifierIdField: "Line", // This is mapped b/w google and github logins.
    isVerifierIdCaseSensitive: false,
    connection: "line",
  },
});
(window as any).Web3AuthProvider = web3authProvider;

} catch (error) {
console.error(error);
}
}

image
image987Ă—342 48.4 KB

When we enter login cred in line after that in web3auth facing the error of cannot read properties of undefined to lowercase

Thanks for providing the details and screenshots, Aman! Here’s a summary of your issue for the support team:


Issue Summary

  • Platform: JavaScript (likely Next.js, based on environment variables and code)
  • SDK: Web3AuthNoModal (exact version not specified)
  • Login Provider: LINE (custom JWT login)
  • Error: After entering LINE credentials, you get an error:
    Cannot read properties of undefined (reading 'toLowerCase')
  • Code Snippets Provided:
    • Web3Auth and OpenloginAdapter initialization
    • Example loginWithLine function
  • Screenshots Provided:
    • Error message in browser console
    • (Possibly) Auth0/LINE login flow

Relevant Login Config:

line: {
  verifier: 'xana-testnet',
  typeOfLogin: 'jwt',
  clientId: 'yrs3b6Z87XW9c48rJ2UqF3Kz5cLCfO9Z',
}

Login Call:

Web3Auth.connectTo("openlogin", {
  redirectUrl: "http://localhost:3000/mamamia",
  loginProvider: "line",
  extraLoginOptions: {
    domain: "https://dev-05dkqxcijmqnze5g.us.auth0.com",
    verifierIdField: "Line",
    isVerifierIdCaseSensitive: false,
    connection: "line",
  },
});

Next Steps / Questions

To help resolve this, could you please provide the following (if possible):

  1. SDK Version:
    Which version of @web3auth/web3auth (or related packages) are you using?

  2. JWT Sample:
    Since you’re using a custom JWT verifier, can you share a sample of the JWT (idToken) returned from LINE/Auth0 (with sensitive info redacted)? This helps check if the expected fields are present.

  3. Verifier Setup:

    • What is the exact verifier name and verifier sub-identifier configured in your Web3Auth dashboard for LINE?
    • Is the field Line (capital L) actually present in your JWT, or should it be line (lowercase)? This might relate to the error.

Possible Solution / Suggestions

  • The error toLowerCase of undefined often means a field expected in the JWT is missing or misnamed.
  • Double-check that your verifierIdField (Line) matches the actual field in your JWT. If the JWT contains line (lowercase), update verifierIdField: "line".
  • Review the Web3Auth Custom JWT Login Docs for more on required JWT fields and verifier setup.

Let us know the above details, and we’ll help you debug further! If you spot the field mismatch, try correcting it and see if that resolves the error.

Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. Web3Auth Developer Office Hours

Hey @aman.sharma
Please upgrade to the latest version of Web3Auth. You’re using a 2 yr old, deprecated version of Web3Auth. You may be facing unexpected issues because of that.
Please make use of the migration guides in our docs for your specific case: Documentation | Web3Auth