Hey team, how can i get user's email id which they...
# support-questions-legacy
a
Hey team, how can i get user's email id which they entered in FE, and set it in accessTokenPayload i tried using
Copy code
userInfo, err := passwordless.GetUserByID(userID)
but it errors out log
Copy code
text
2024/04/07 21:58:59.624599 superToken.go:187: [Info] User Info: map[_default:map[request:0x1400063f9e0]]
2024/04/07 21:58:59.624630 superToken.go:188: [Info] acces token payload map[iss:http://localhost:4000 st-perm:map[t:1712507339623 v:[]] st-role:map[t:1712507339622 v:[]]]
2024/04/07 21:58:59.636381 superToken.go:98: [Info] 96edb6d9-74ad-4c81-9801-6cdf00b84ec5
2024/04/07 21:58:59.638689 roles.go:94: [Info] Role added to user: &{false} with user_id:96edb6d9-74ad-4c81-9801-6cdf00b84ec5 role: admin
r
hey @albatroz
where are you calling passwordless.GetUserByID?
a
somewhere here
r
whats the golang error you see?
a
r
sorry, this is a little hartd to debug with the screenshots
which function is throwing the error exactly? And whats the input to that function?
a
github.com/supertokens/supertokens-golang/recipe/session.CreateNewSession
r
and what are the inputs you are giving to it exactly?
log them out in a serialised way so it's clear
a
hey, i understood the error
the issue is i was calling passwordless.UserInfo
but was using emailpassword.
we are using 2 different method, is there a way to get email and set it to accesstokenpayload?
r
yea, you can use emailpassword.getUserById
and that object contaisn the emaiul
a
what if they session if created from passwordless? how can i get the value now?
r
well, if the emailpassword.getUserById returns nil, then you can try passwordless and that will work
a
understood thanks it worked