Internal Server Error - pnp web sdk, no-modal, sms_passwordless,

When asking for help in this category, please make sure to provide the following details:

  • SDK Version(package.json):
  • Platform:
  • Browser Console Screenshots:
  • If the issue is related to Custom Authen
    스크린샷 2024-08-30 15.40.26
    스크린샷 2024-08-30 15.43.15
    tication, please include the following information (optional):
    • Verifier Name:
    • JWKS Endpoint:
    • Sample idToken (JWT):

Also, kindly provide the Web3Auth initialization and login code snippet below. This will help us better understand your issue and provide you with the necessary assistance.

Hi!

I’m using the Plug and Play Web SDK no- Modal, and I’ve attempted several SMS passwordless connections on Dev Net.

However, I can no longer proceed, and I can’t determine the reason why.
It seems like it might be a Web3Auth server issue.

I wonder why I can’t complete the OTP steps anymore. I’ll attach the error log screenshots for reference.

Thanks.

Hi 김도연,

Thanks for reaching out! It sounds frustrating not to be able to proceed with the OTP steps. Let’s work together to sort this out.

Details provided:

I need a few more details to assist you better:

  1. SDK Version (from your package.json)
  2. Platform: (e.g., Web, Mobile)
  3. Web3Auth Initialization & Login Code Snippets: Please share your initialization and login code so we can check if there is any issue in the implementation.

Once we have these details, the support team can look into your problem and assist you further.

This response was generated by the Web3Auth Bot. A person from the Web3Auth team will also review your query and provide an answer shortly.

Thanks for your patience!

Please select an SDK-specific category from the dropdown when creating a topic here. Use this category for generic help-related topics. Also, remove these lines when asking for generic Help.

  1. @web3auth/no-modal”: “^8.12.4”,
  2. Web
  3. Initialization & Login Code
'use client';

import { useEffect, useState } from "react";
import { BrowserProvider, ethers } from "ethers";
import { web3auth } from "../../config/web3authConfig";
import { useAtom } from 'jotai';
import { providerAtom } from "@/src/atoms/userInfoAtom";

export const useProvider = () => {
    const [provider, setProviderAtom] = useAtom(providerAtom);
    const [isInitialized, setIsInitialized] = useState(false);

    useEffect(() => {
        const initProvider = async () => {
            try {
                if (!isInitialized && !provider) {
                    await web3auth.init();
                    if (web3auth.provider) {
                        const ethersProvider = new ethers.BrowserProvider(web3auth.provider as ethers.Eip1193Provider);
                        setProviderAtom(ethersProvider);
                        setIsInitialized(true);
                        console.log('Ethers Provider 초기화 완료')
                    }
                }
            } catch (error) {
                console.error("Provider 초기화 실패:", error);
            }
        };

        if (!isInitialized) {
            initProvider();
        }

    }, [isInitialized, provider, setProviderAtom]);

    const resetProvider = () => {
        setProviderAtom(null);
        setIsInitialized(false);
    };

    return {
        provider,
        isInitialized,
        setIsInitialized,
        resetProvider,
    };
};
'use client';

import { useCallback } from "react";
import { WALLET_ADAPTERS } from "@web3auth/base";
import { web3auth } from "../../config/web3authConfig";
import { useProvider } from "../contract/useProvider";

export const useSmsAuth = () => {
    const { provider, setIsInitialized } = useProvider();

    const onClickSmsAuth = useCallback(async (smsNumber: string) => {
        const cleanedNumber = smsNumber.replace(/[-\s]/g, "");
        const formattedNumber = `+82-${cleanedNumber.slice(-10)}`;

        try {
            console.log(web3auth.connected);
            console.log(provider);
            if (!web3auth.connected) {
                const web3authProvider = await web3auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
                    loginProvider: "sms_passwordless",
                    extraLoginOptions: {
                        login_hint: formattedNumber,
                    },
                });
                setIsInitialized(true);
                console.log(web3authProvider);
            }
        } catch (error) {
            console.error('SMS Login failed:', error);
        }
    }, [provider, setIsInitialized]);

    return {
       onClickSmsAuth
    };
};

I found that WEB3AUTH Client ID was the problem

I tested with another dev client id and it worked

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.