// This user does not belong to this plugin, skip it
if (user.pluginAuth !== obj.pluginName) return null
+ checkUserValidityOrThrow(user)
+
return user
}
}
const passwordMatch = await user.isPasswordMatch(password)
if (passwordMatch !== true) return null
- if (user.blocked) throw new AccessDeniedError('User is blocked.')
+ checkUserValidityOrThrow(user)
if (CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION && user.emailVerified === false) {
throw new AccessDeniedError('User email is not verified.')
return user
}
+
+function checkUserValidityOrThrow (user: MUser) {
+ if (user.blocked) throw new AccessDeniedError('User is blocked.')
+}