Torus session timeouts

on our website https://upvsdown.com - it seems to have an issue with the torus login popup.
up until now we didnt understand why the social login popup keeps appearing after every refresh of the page.
one of our developers says it might be an issue with the session timeouts…
since its starts happening after being logged in for a while.
could you help us with debugging this? how long is the session before it reaches timeout?


image (34)

@idob Thanks for your patience.

The parameter sessionTime determins the sessiontime in your initization code for modal SDK.

sessionTime (in seconds) for idToken issued by Web3Auth for server side verification. Note: max value can be 7 days (86400 * 7) and min can be 1 day (86400)

thank you for the reply.
so it means that im supposed to get that error and that login popup after being connected for 1 day?

During login with Web3Auth, passing the sessionTime parameter will allow users to stay authenticated with Web3Auth for up to 1 day by default or a maximum of 7 days until they log out or their session data is cleared.

What is setting you have used in your code for sessionTime ?

currently we dont have “sessionTime” in our code.
our dev asks:
if i dont pass sessionTime
what should be the time?
and where should i pass it if i use this code:

new Web3Auth({
clientId, // Get your Client ID from Web3Js Dashboard
web3AuthNetwork: APP.state.get(‘web3_auth_network’),
storageKey: “local”,
uiConfig: {
appLogo:
theme: { isDark: true, colors: { primary: “#123653”, background: “#123653”, torusBrand1: “#000000” }, },
loginMethodsOrder: [‘google’, ‘facebook’, ‘apple’, ‘linkedin’]
},
chainConfig: {
chainNamespace: “eip155”,
chainId: chainId, // hex of 137, polygon mainnet
rpcTarget: APP.state.get(‘eth_ws_web3auth’),
// Avoid using public rpcTarget in production.
// Use services like Infura, Quicknode etc
//displayName: displayName,
//blockExplorer: blockExplorer,
//ticker: ticker,
//tickerName: tickerName,
},
})


new TorusWalletConnectorPlugin({
torusWalletOpts: {
},
walletInitOptions: {
buildEnv: “polygon”,
showTorusButton: true,
whiteLabel: {
theme: { isDark: true, colors: { primary: “#123653”, background: “#123653”, torusBrand: “#000000” }, },
name: ‘Playnance’,
logoDark: logoLight,
logoLight: logoLight,
featuredBillboardHide: true,
disclaimerHide: true,
useWalletConnect: true,
enableLogging: false
},
},
})

The default value would be 1 day or 86400 seconds

new Web3Auth({
clientId, // Get your Client ID from Web3Js Dashboard
web3AuthNetwork:APP.state.get(‘web3_auth_network’),
storageKey: “local”,
sessionTime: 86400, // 1 day in seconds or max (86400 * 7)

thanks ! , we will try that and get back to you with an update if it helped