hi, when i create a user , the primary user flag i...
# support-questions-legacy
a
hi, when i create a user , the primary user flag is getting set as false , but i need it to bet set as true by default to enable account linking from different social logins
r
Hey. For that you need to enable the account linking feature.
a
I used this but when i am creating user via google, primary User flag is set to true , but in case of facebook it is set to false, due to this account in google and facebook are not getting linked with each other and throwing error Code - 006
r
is the email that is returned from fb verified?
as in verified by fb*
and are you returning true from shouldDoAutomaticAccountLinkling?
a
shouldDoAutomaticAccountLinking: async (newAccountInfo: AccountInfoWithRecipeId & { recipeUserId?: RecipeUserId }, user: User | undefined, tenantId: string, userContext: any) => { if (newAccountInfo.recipeUserId !== undefined && user !== undefined) { let userId = newAccountInfo.recipeUserId.getAsString(); let hasInfoAssociatedWithUserId = false if (hasInfoAssociatedWithUserId) { return { shouldAutomaticallyLink: false } } } return { shouldAutomaticallyLink: true, shouldRequireVerification: true } }
this is my shouldDoAutomaticAccountLinking func same as the docs
for primary user , email should be verified in facebook?
r
> email should be verified in facebook? Yes. For auto asccount linking, you need to have all methods as verified. If you want to prevent that, then you can return false for the value of
shouldRequireVerification
. But, this will cause security issues!
a
ok, thanks