Rename User#findByEmail to User#findByConfirmedEmail to remove ambiguity

This commit is contained in:
Colin McDonald 2016-07-23 14:28:44 -04:00
parent 18c0868baf
commit 95440504d5
3 changed files with 3 additions and 3 deletions

View File

@ -132,7 +132,7 @@ public final class User {
} }
} }
public static void findByEmail(String email, SingleResultCallback<User> callback) { public static void findByConfirmedEmail(String email, SingleResultCallback<User> callback) {
usersCollection.find(new Document("email", email)).first(SyncUtils.vertxWrap(callback)); usersCollection.find(new Document("email", email)).first(SyncUtils.vertxWrap(callback));
} }

View File

@ -24,7 +24,7 @@ public final class GETUsersIdVerifyPassword implements Handler<RoutingContext> {
} }
if (user == null) { if (user == null) {
user = SyncUtils.runBlocking(v -> User.findByEmail(ctx.request().getParam("userId"), v)); user = SyncUtils.runBlocking(v -> User.findByConfirmedEmail(ctx.request().getParam("userId"), v));
} }
if (user == null) { if (user == null) {

View File

@ -50,7 +50,7 @@ public final class POSTUsersIdRegisterEmail implements Handler<RoutingContext> {
return; return;
} }
User sameEmail = SyncUtils.runBlocking(v -> User.findByEmail(email, v)); User sameEmail = SyncUtils.runBlocking(v -> User.findByConfirmedEmail(email, v));
if (sameEmail != null) { if (sameEmail != null) {
ErrorUtils.respondInvalidInput(ctx, email + " is already in use."); ErrorUtils.respondInvalidInput(ctx, email + " is already in use.");