Fix isEmail validation failure on valid emails during Docker setup (#835)

This commit is contained in:
Chris 2026-02-11 15:42:11 +02:00 committed by GitHub
parent 2ce1c62c48
commit 5a1f0650ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 2 deletions

View file

@ -11,12 +11,13 @@ const _ = require('lodash');
* @returns {Promise<{user: User, created: boolean}>} User object and creation status
*/
async function createOrUpdateUser(email, password) {
const normalizedEmail = email.trim().toLowerCase();
const hashedPassword = await bcrypt.hash(password, 10);
const [user, created] = await User.findOrCreate({
where: { email },
where: { email: normalizedEmail },
defaults: {
email,
email: normalizedEmail,
password_digest: hashedPassword,
},
});