If user is registered via Github, is it possible t...
# support-questions-legacy
n
If user is registered via Github, is it possible to force them enter and confirm an email?
r
Let's talk in a thread.
n
only for cases if their email is not public in their github profile
r
Ah i see. So that is also possible.. give me a few mins
So you can do the following: - If github doesn't give you an email, you can put in a place holder email instead. - Then check post that, a session will be created for that user automatically. - In the session, you can put info signifying that the user needs to input an email, and then make your frontend route to a UI that asks them for their email. - Once their enter their email, you can associate that to the github account and mark the email as unverified which should then trigger an email verification flow.
- Post email verification flow, you can update the session info to signify that the user now has an email.
n
associate that to the github account and mark the email as unverified
how to do this part?
r
- You can get the github user ID of the user using the
GetUserById
function (https://pkg.go.dev/github.com/supertokens/supertokens-golang@v0.8.2/recipe/thirdparty#GetUserByID) and then call the
SignInUp
function with that user ID and the new email (https://pkg.go.dev/github.com/supertokens/supertokens-golang@v0.8.2/recipe/thirdparty#SignInUp) which will update that user's email in supertokens. You can pass
IsVerified
as
false
in the
EmailStruct
which is one of the args to that function.
n
perfect, thanks!
I was confused because I was looking at https://app.swaggerhub.com/apis/supertokens/CDI/2.15.1#/ThirdParty%20Recipe/thirdPartySigninup and there is no
IsVerified
flag.
r
> can pass IsVerified as false in the EmailStruct which is one of the args to that function. A mistake from my side, just changing the email marks it as unverified by default. The isVerified boolean in the function i mentioned was used previously but then we removed it from the API cause we wanted to decouple the social login functions from the email verificaiton functions. We still need to update the function signature.
2 Views