Fix boolean logic

This commit is contained in:
Phillip Thelen
2022-02-09 14:12:23 +01:00
parent 7d090d059b
commit bf4ffbe6b0
+1 -1
View File
@@ -128,7 +128,7 @@ async function registerLocal (req, res, { isV3 = false }) {
}, { 'auth.local': 1 }).exec();
if (user) {
if (existingUser && user._id !== existingUser._id) {
if (!existingUser || user._id !== existingUser._id) {
if (email === user.auth.local.email) throw new NotAuthorized(res.t('emailTaken'));
// Check that the lowercase username isn't already used
if (existingUser) {