wispy-oliveW
Refineโ€ข3y agoโ€ข
9 replies
wispy-olive

How Can I get user email with Google Login AuthProvider

โ„น๏ธ info
I'm using Google Login as AuthProvider & Supabase as database

I want to get user Email by a given user id

There's no email field in my supabase's profiles table by default (as the pic)

โ“ issue
1. So, I'm wondering, do I need to save email after user login?
If I did this, I can get user email by useOne easily.
If this is the right answer, can you give some reference to do this? ๐Ÿ™โ€
I saw there's onFinish property here (https://refine.dev/docs/api-reference/core/hooks/auth/useLogin/#usage), but it seems it's for normal login (account & password)
But I'm using Google Login as AuthProvider.
I got no idea how to do this


2. Is there's a hook like useGetIdentity to get user data?
when I use useGetIdentity, I can get my own user data, including email even it isn't in database.

It seems useGetIdentity can only get the current user data.
Is there's a hook like useGetIdentity to get user data?
SCR-20230127-2xl.png
useLogin data hook from refine is a modified version of react-query's useMutation for authentication.
useLogin | refine
Was this page helpful?