Skip to content

Commit 7d0d14c

Browse files
committed
wordsmithery and grammar
1 parent 6149c86 commit 7d0d14c

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

src/RestWrite.js

+18-10
Original file line numberDiff line numberDiff line change
@@ -620,16 +620,23 @@ RestWrite.prototype._validateUserName = function() {
620620
return Promise.resolve();
621621
}
622622
/*
623-
Username's should be unique when compared case insensitively
623+
Usernames should be unique when compared case insensitively
624624
625-
User's should be able to make case sensitive usernames and
625+
Users should be able to make case sensitive usernames and
626626
login using the case they entered. I.e. 'Snoopy' should preclude
627627
'snoopy' as a valid username.
628628
629-
Users that use authentication adapters should enforce unique ids
630-
through a unique index on username. Failure to enforce through an index
631-
allows for a potential collision for adapter users (a low probability outcome)
632-
but more importantly will have poor performance on this validation.
629+
However, authentication adapters require a looser check that takes
630+
case into consideration when determining uniqueness.
631+
632+
The username field should have a unique index on the database as
633+
Failure to enforce through an index allows for a potential collision
634+
for adapter users (a low probability outcome) but more importantly
635+
will have poor performance on this validation.
636+
637+
The check below has the potential to not allow a valid
638+
username for an adapter other than anonymous, this should
639+
be fixed.
633640
*/
634641
return this.config.database
635642
.find(
@@ -655,9 +662,9 @@ RestWrite.prototype._validateUserName = function() {
655662
};
656663

657664
/*
658-
As with username's, parse should not allow case insensitive collisions of email
659-
unlike with usernames (which can have case insensitive collisions) emails should
660-
never have a case insensitive collision.
665+
As with usernames, Parse should not allow case insensitive collisions of email.
666+
unlike with usernames (which can have case insensitive collisions in the case of
667+
auth adapters), emails should never have a case insensitive collision.
661668
662669
This behavior can be enforced through a properly configured index see:
663670
https://docs.mongodb.com/manual/core/index-case-insensitive/#create-a-case-insensitive-index
@@ -685,7 +692,8 @@ RestWrite.prototype._validateEmail = function() {
685692
this.className,
686693
{
687694
email: { $regex: `^${this.data.email}$`, $options: 'i' },
688-
objectId: { $ne: this.objectId() } },
695+
objectId: { $ne: this.objectId() },
696+
},
689697
{ limit: 1 },
690698
{},
691699
this.validSchemaController

0 commit comments

Comments
 (0)