fix: Lowercase email from auth providers to match any outstanding invites (#3369)

* fix: Lowercase email from auth providers to match any outstanding invites

* fix
This commit is contained in:
Tom Moor
2022-04-12 21:31:55 -07:00
committed by GitHub
parent 1de732c82a
commit d3ecab3489
5 changed files with 8 additions and 10 deletions

View File

@@ -86,7 +86,9 @@ export default async function userCreator({
// shell user record.
const invite = await User.findOne({
where: {
email,
// Email from auth providers may be capitalized and we should respect that
// however any existing invites will always be lowercased.
email: email.toLowerCase(),
teamId,
lastActiveAt: {
[Op.is]: null,