A basic metamask authentication app in nextjs working in local env but not in production in digital ocean.
https://cyberhornetscolony.club/staging
server url: https://ty7yus3mwpf6.usemoralis.com:2053/server
import { useMoralis } from “react-moralis”;
const Navbar = () => {
const { authenticate, isAuthenticated, logout, user } = useMoralis();
…
…
{isAuthenticated ? (
<>
<button onClick={logout}>Logout</button>
<h4>{user.get("ethAddress")}</h4>
</>
) : (
<button
onClick={() => {
authenticate({ provider: "metamask" });
}}
>
Sign in with MetaMask
</button>
)}
…