[SOLVED] Invalid session token ! please help

Uncaught (in promise) Error: Invalid session token
at Function.

This error is giving me since yesterday. and I have not touched the login code I have deleted cache reinstalled the packages changed wallet and it is not solved and the login worked perfectly

login code: 

const Login = async () => {

      if (!state.authenticated) {

        // await Moralis.enableWeb3();

        // if (chainId != '80001') {

        //   await switchNetworkMumbai()

        // }

        await authenticate({signingMessage: "Welcome to Koolinart"})

          .then(async function (user) {

           

            const userMarketType = user!.get("loginType")

            dispatch({

              type: 'USER_AUTHENTICATED',

              payload: true

            })

            dispatch({

              type: 'GET_LOGIN_TYPE',

              payload: userMarketType

            })

            dispatch({

              type: 'USER_RENDER',

              payload: user

            })

            return

          })

          .catch(function (error) {

            console.log(error);

          });

      }

    }

What line of code gives that error?

You can now fix the error, update morales and it is not giving me a token error, now it gives me a token error, but in this code on the line:

const getMaticPrice = async () => {

    const price = await Moralis.Web3API.token.getTokenPrice({

      address: auth.currencyContract,

      chain: `eth`,

    });

    setPriceMatic(price.usdPrice);

  }

this is error on console:

TypeError: Cannot read properties of undefined (reading ‘token’)

this means that this part is undefined, it could be related to what version of Moralis SDK you are using

if I could realize that when updating moralis I should change the import for this import { useMoralisWeb3Api } from “react-moralis”; and ready fixed the error, thanks for your time. I’ll ask a few questions later about running my own moralis server, bug questions and how should I migrate to my own server? What will happen to the servers that I have hosted! will they remove them?

current servers will be archived and deleted at some time in the future

including the self host servers themselves ?

no, your own self hasted server is what you control, it will stay as long as you want

What other important change should I take into account for the future, since I try to put a project into production and I see more and more things taking another direction, another question, is this host for the back end useful for moralis? https://www.digitalocean.com/

you can use any provider for your self hosted server, that one should work fine, you can try locally at the beginning while you are testing