How to get email when using Web3Auth?

I mean you can too, why not? but maybe you need to set the email manually after authenticating so it is also stored in Moralis DB, but yeah donā€™t think that should be a problem

Canā€™t seem to figure this out yet @cryptokid

Web3Auth provides a ā€œGet User Infoā€ method to get the userā€™s info. But I canā€™t seem to figure out how to run this through Moralis

1 Like

Hi @pushpit07
I have found out this snippet to get user info

You can try and let me know if its working meanwhile i am also using Torus to get user info, will share code snippet once ready

Iā€™ve tried but this doesnā€™t work when using Web3Auth with Moralis

https://docs.web3auth.io/integration-builder/?b=wallet&chain=Ethereum&lang=React

check this snippet using Torus module to get userinfo

Still not working. See this- How to get email when using Web3Auth?

How do I access the userā€™s email when they signup using Google? I want to know that. Is there any way to do so? Can you try doing that and let me know what you find?

Hey,
did it help? I havent got the chance to try yet

let me know the status, will try again today

Nope. No progress on this

I arrived here after a couple of hours trying to get email after authentification by google. Have you found a way to get this information? @pushpit07

Thanks

Hey @Deving. Havenā€™t found any solution yet

1 Like

Have you tried seeing if itā€™s available with getUserInfo?

Can try using it in node_modules\moralis\lib\browser\Web3Connector\Web3AuthConnector.js.

I was looking for this feature also. Web3Auth has this but I am not able to call it through Moralis await web3auth.getUserInfo();

Hello friends, has anyone found any solutions to this. Being able to call the web3 auth function of
// await web3auth.getUserInfo(); would be super sweet. If that is not possible I would appreciate any advice on hacks or workarounds.

Does anybody know if you can get the users info from the other similar company, I think its called MagicAuth?

You can check Magicā€™s docs if they have a method of obtaining the user email.

web3auth.getUserInfo() does give the user email if you adjust the Web3Auth connector, so youā€™d have to look at having it be saved or retrievable in some way.

Web3auth

Hello everyone,

Any luck with this? @SkullCrusherAF

@alex seemed to retrieve succesfully but I have not been able to implement.

I am new to moralis and the javascript SDK so would appreciate a dummy breakdown.

Thanks in advance

1 Like

It looks like Web3Auth actually saves a localStorage item called openlogin_store after you authenticate, which has most of the info in that screenshot above like the email address. So you could easily get it from this instead.

If you want to customize the connector, you can use this as an example where you just add getUserInfo e.g. and then look to retrieve or save the info you want.

// Authenticate
await web3auth.initModal();
let provider = null;

const userInfo = await web3auth.getUserInfo();
console.log("userInfo", userInfo);
1 Like

This is great stuff, I will probably just look for the openlogin_store. Thanks!

Thanks for your quick response @alex
I can give this a go, but any idea if this is still possible when using the Moralis integration of Web3Auth? The ability to automatically add users to our backend database is really powerful, otherwise how can I do it manually and sync with moralis?

You could save the email (or whichever details you want from getUserInfo()) for the user when they log in - the rest of their details still sync as usual so you will need to do this with another step in code.