fix error

This commit is contained in:
Phillip Thelen
2022-02-09 13:55:14 +01:00
parent 54bb4e9fe1
commit 7d090d059b
+1 -1
View File
@@ -128,7 +128,7 @@ async function registerLocal (req, res, { isV3 = false }) {
}, { 'auth.local': 1 }).exec();
if (user) {
if (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) {