fix: username / email inconsistency when creating new users
Fixed UserExistsError error message
This commit is contained in:
@@ -19,6 +19,9 @@ export default function initCollectionsLocal(ctx: Payload): void {
|
||||
if (collection.auth && !collection.auth.disableLocalStrategy) {
|
||||
schema.plugin(passportLocalMongoose, {
|
||||
usernameField: 'email',
|
||||
errorMessages: {
|
||||
UserExistsError: 'A user with the given email is already registered',
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user