Hi, i created a login function that directs to a page, “dashboard.html”, its functioning in mac browser but i edited the code for mobile, which has no response, below is the code, what should i chnage?
login = async () => {
try {
if (typeof web3 !== 'undefined') {
const user = await Moralis.authenticate({
signingMessage: "Welcome to BUSDPlanet",
chainID: "97",
})
.then(function (user) {
console.log("logged in user:", user);
console.log(user.get("ethAddress"));
window.location.href = "dashboard.html";
})
.catch(function (error) {
console.log(error);
});
// web3 = await Moralis.enable();
} else {
const user = await Moralis.authenticate({
signingMessage: "Welcome to BUSDPlanet",
chainID: "97",
provider: "walletconnect",
})
.then(function (user) {
console.log("logged in user:", user);
console.log(user.get("ethAddress"));
window.location.href = "dashboard.html";
})
.catch(function (error) {
console.log(error);
});
web3 = await Moralis.enable({
provider: "walletconnect" });
}
walletAddress = user.get('ethAddress');
} catch (error) {
console.log('authenticate failed', error);
}
}