Archived Content from Web3Auth Community
This topic was originally posted by afarley on 3/5/2024.
This content has been migrated from our previous community forum to preserve valuable discussions.
- SDK Version: v8
- Platform: No Modal SDK
Using NoModal SDK and MetaMask, calling authenticatedUser() results in a 400 response from https://authjs.web3auth.io/siww/verify:
{
"statusCode":400,
"error":"Bad Request",
"message":"Validation failed",
"validation": {"body":{"source":"body","keys":["timeout"],"message":"\"timeout\" must be greater than or equal to 86400"}}
}
Web3Auth Instance Code:
export const getWeb3AuthInstance = (chains: readonly Chain[]) => { const chainConfig = { chainNamespace: CHAIN_NAMESPACES.EIP155, chainId: '0x' + chains[0].id.toString(16), rpcTarget: chains[0].rpcUrls.default.http[0], displayName: chains[0].name, tickerName: chains[0].nativeCurrency?.name, ticker: chains[0].nativeCurrency?.symbol, blockExplorerUrl: chains[0].blockExplorers?.default.url[0] as string, };const privateKeyProvider = new EthereumPrivateKeyProvider({
config: {chainConfig},
});const web3AuthInstance = new Web3AuthNoModal({
clientId: environment.web3AuthClientId,
web3AuthNetwork: OPENLOGIN_NETWORK.TESTNET,
storageKey: ‘local’,
chainConfig,
enableLogging: false,
sessionTime: 3600, // 1 hour in seconds,
privateKeyProvider,
});web3AuthInstance.configureAdapter(
new OpenloginAdapter({
adapterSettings: {
uxMode: ‘redirect’,
replaceUrlOnRedirect: false,
},
loginSettings: {
mfaLevel: ‘none’, // Testnet
},
}),
);web3AuthInstance.configureAdapter(new MetamaskAdapter());
return web3AuthInstance;
};
const {idToken} = await web3Auth!.authenticateUser();