https://supertokens.com/ logo
a

ashlite

06/16/2022, 4:24 PM
Hey just realize That the data saved in db only providerId and email. So to get another such as user name from third party, do I need to request it using the access token?
r

rp

06/16/2022, 4:24 PM
Hey! Yes you do need to request it yourself.
a

ashlite

06/16/2022, 4:27 PM
Then in this example https://supertokens.com/docs/thirdpartyemailpassword/common-customizations/getting-provider-access-token it use google as example. Are the other provider use the same method?
r

rp

06/16/2022, 4:28 PM
Yes. Same method
The authCodeResponse’s structure can be different based on the provider though. So be sure to check that
a

ashlite

06/16/2022, 4:29 PM
ahhhh
that's make sense
Regarding this tried using google and facebook even though both have pretty much different structure, it is a little weird to check the AuthCodeResponse property structure to know the provider. Suggestion to add loginProvider prop that indicating the login method especially for third party.
r

rp

06/16/2022, 5:39 PM
You can use
input.provider.id
to know what's the provider
for example, the value of that will be
"google"
if it's sign in with google, or else if it's fb, it will be
"facebook"
and so on.
a

ashlite

06/16/2022, 5:42 PM
owh....
r

rp

06/16/2022, 5:42 PM
hehe
perhaps should be in the example in the docs.