Hello, has someone implemented supertokens email-p...
# general
j
Hello, has someone implemented supertokens email-password with Hasura?
r
Hey! Yes. Do you have any specific questions?
Hey. Yes. Do you have any specific questions?
j
Well, there is an example for email-password, and there is another example with third party email. I've seen that there a function to obtain the user data from third party email provider to fill 'x-hasura-user-id' claim, but how can I obtain the same data from email-password
Another question related, It is necesary to manually create a Users table in Hasura or will Supertokens manage this for me?
You don’t need to create a users table in hasura.
s
Hi, sorry for hijacking the thread but I am not sure I understand what do you mean by this. We need to match x-hasura-user-id with userInfo.email which means we need a matching user-id.
Hasura permission custom check for user-id
So in order to achieve this we need a matching users table at Hasura using user email as ID. Or am I missing anything here?
r
right yea.. that makes sense. You are right.
What I meant by my original comment is that you don't need to create a users tables containing all the info of the user as stored in supertokens. Just the userId / email mapped to your application data.
s
Ok, that makes sense. Thanks for the clarification.
On another note is there a way to get google profile info without making a second call to https://www.googleapis.com/oauth2/v2/userinfo
via supertokens-node/recipe/thirdpartyemailpassword or supertokens-node/recipe/session.. I have tried ThirdPartyEmailPassword.getUserById(response.user.id) but it is missing name and family name etc..
r
@solminded if you are using our inbuilt google provider, there isn't a way to do that without making a second call to google. You can always implement it as a custom oauth provider and then in the
getProfileInfo
function, you can query the endpoint to get the info you like, and put it in your db as well.
and the code for the custom oauth provider, you can copy it from our SDK's code
s
ok will try that, thanks!