Hi, I've been trying to get the first and last na...
# support-questions-legacy
a
Hi, I've been trying to get the first and last name from the google social login to sync over to supertoken. Is there some kind of configuration needed or how can I solve it? Peeking at the code it looks like it fetches the profile from google, but it only seems to sync the email? https://github.com/supertokens/supertokens-node/blob/master/lib/ts/recipe/thirdparty/api/implementation.ts#L142 Thanks!
r
hey @ahlstrand.
we give you the access token. You can use that to get the name of the user and add it to the user metadata recipe
with the key
first_name
and
last_name
a
Is the google access-token returned? Or do I need to use some hook to get it?
r
it's returned to you in the override function for sign inup
which recipe are you using?
a
Right now I'm trying the email/password + social.
a
Thanks!
j
Hey 👋 👋 @rp_st I'm also trying to get profile information from github and save it to user metadata. I know I can use the access token from github to fetch the profile details, but how would i invalidate the session if the fetch fails? I tried returning a random error on the override function for SignInUpPOST method but that didn't break the process of logging the user in.
Copy code
return tpmodels.SignInUpPOSTResponse{
  OK: nil,
}, fmt.Errorf("Test Error")
So how would i go on to break the login process in`SignInUpPOST` method Any help would be much appreciated ✌️
r
what happens if you return a random error? Do you get a 500 http status code on the frontend?
j
yup, i am getting a 500 status code on the frontend
r
right. So thats expected
But does it also create a session for you?
j
yeah it does
r
hmm. I see. That shou;dn't be happening. Can you open a github issue about this? Also, in the meantime, the way you can fix this is to call response.session.revokeSession before returning your error
j
after looking at the network logs, after getting a 500 status code error at
http://localhost:8080/signinup
there is a request to
http://localhost:3000/auth/?error=signin
followed by
http://localhost:3000/auth?error=signin
and in the end a request is being made to
http://localhost:3000/sign-in
which signs the user in. and the status code is 200
yup
r
huh
> and in the end a request is being made to http://localhost:3000/sign-in which signs the user in. and the status code is 200 Im not sure where this is coming from.. our code doesn't call this
j
oh sorry, nvm thats the page that i'm currently working on.
r
ok
r
thanks
17 Views