Save email from third party user

This commit is contained in:
Rory Powell 2021-07-08 11:54:16 +01:00
parent b1c5b5cf35
commit bf94125d33
1 changed files with 2 additions and 1 deletions

View File

@ -40,7 +40,7 @@ exports.authenticateThirdParty = async function (
key: thirdPartyUser.email, key: thirdPartyUser.email,
include_docs: true, include_docs: true,
}) })
let userExists = users.rows.length > 0 const userExists = users.rows.length > 0
if (requireLocalAccount && !userExists) { if (requireLocalAccount && !userExists) {
return authError(done, "Email does not yet exist. You must set up your local budibase account first.") return authError(done, "Email does not yet exist. You must set up your local budibase account first.")
@ -100,6 +100,7 @@ function constructNewUser(userId, thirdPartyUser) {
_id: userId, _id: userId,
provider: thirdPartyUser.provider, provider: thirdPartyUser.provider,
providerType: thirdPartyUser.providerType, providerType: thirdPartyUser.providerType,
email: thirdPartyUser.email,
roles: {} roles: {}
} }