https://supertokens.com/ logo
get email on frontend
r

rajubai

05/17/2023, 9:05 AM
hi, How to get user email in react frontend
r

rp

05/17/2023, 9:37 AM
hey @rajubai you need to add the email to the access token payload yourself with the createNewSession override
r

rajubai

05/17/2023, 10:18 AM
so i need to store email to my db and then retrieve and use as payload
anyway to get from session data
r

rp

05/17/2023, 11:14 AM
you don't need to store email in your db. You can get the email of the user using our functions for the recipe on the backend like EmailPassword.getUserById.
then in the createNewSession override, add the email to the access token payload and read it on the frontend
r

rajubai

05/18/2023, 6:36 AM
Thanks