Hello
I can use isAuthenticated and isAuthenticating when I use authentication method.
Now I want to use enableweb3 instead of authentication and my question is is there any way to check user isauthenticated or not?
Thank you
You can also use the isAuthenticated
value from useMoralis
hook before using enableweb3
to check if the there is an authenticated user.
I didn’t understand. when I use isAuthenticated after using enableweb3 it returns null.
Can you share your code?
and what exactly are you trying to achieve
I want to authenticate user and after that change button text. I just want to learn simple things.
I used authenticate and everything was fine and now I want to do it with enableweb3.
Try this code.
const { authenticate, isAuthenticated } = useMoralis();
const { enableWeb3, isWeb3Enabled } = useMoralis();
return (
<div>
<button onClick={() => authenticate()}>
{isAuthenticated ? <>Authenticated</> : <>Authenticate</>}
</button>
<button onClick={() => enableWeb3()}>
{isWeb3Enabled ? <>Web3 Enabled</> : <>Enable Web3</>}
</button>
</div>
);
thank you its working