We have successfully implemented the web3Auth modal and we’re currently receiving the JWT issued by web3Auth without problem.
Just like the sample in the docs, we are getting a JWT payload (decoded) that looks like this:
{
"iat": 1655835494,
"aud": "BCtbnOamqh0cJFEUYA0NB5YkvBECZ3HLZsKfvSRBvew2EiiKW3UxpyQASSR0artjQkiUOCHeZ_ZeygXpYpxZjOs",
"iss": "https://api.openlogin.com/",
"email": "xyz@xyz.com",
"name": "John Doe",
"profileImage": "https://lh3.googleusercontent.com/a/AATXAJx3lnGmHiM4K97uLo9Rb0AxOceH-dQCBSRqGbck=s96-c",
"verifier": "torus",
"verifierId": "xyz@xyz.com",
"aggregateVerifier": "tkey-google-lrc",
"exp": 1655921894,
"wallets": [
{
"public_key": "035143318b83eb5d31611f8c03582ab1200494f66f5e11a67c34f5581f48c1b70b",
"type": "web3auth_key",
"curve": "secp256k1"
}
]
}
Now that we have this JWT token and some user data, I want to create a new User
in my own database to extend even more information for a user. That being said, we need a reliable identifier we can use from this token to create that user in our database. So our goal then becomes: every time someone logs in, we check that identifier from the JWT issued by web3Auth against our User
database and if it doesn’t exist, create one.
Email would be ideal but obviously it’s an optional field and some social logins probably wont have it.
Is the public_key
in wallet
going to stay consistent every login? Maybe we can use that?
or maybe the verifierId
?
Any help would be greatly appreciated. We’re currently blocked!