From 95440504d5a62697a698948a84e231a5d6921067 Mon Sep 17 00:00:00 2001 From: Colin McDonald Date: Sat, 23 Jul 2016 14:28:44 -0400 Subject: [PATCH] Rename User#findByEmail to User#findByConfirmedEmail to remove ambiguity --- src/main/java/net/frozenorb/apiv3/model/User.java | 2 +- .../frozenorb/apiv3/route/users/GETUsersIdVerifyPassword.java | 2 +- .../frozenorb/apiv3/route/users/POSTUsersIdRegisterEmail.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/frozenorb/apiv3/model/User.java b/src/main/java/net/frozenorb/apiv3/model/User.java index 8fe7d01..28b016d 100644 --- a/src/main/java/net/frozenorb/apiv3/model/User.java +++ b/src/main/java/net/frozenorb/apiv3/model/User.java @@ -132,7 +132,7 @@ public final class User { } } - public static void findByEmail(String email, SingleResultCallback callback) { + public static void findByConfirmedEmail(String email, SingleResultCallback callback) { usersCollection.find(new Document("email", email)).first(SyncUtils.vertxWrap(callback)); } diff --git a/src/main/java/net/frozenorb/apiv3/route/users/GETUsersIdVerifyPassword.java b/src/main/java/net/frozenorb/apiv3/route/users/GETUsersIdVerifyPassword.java index 4f5545a..aac2de8 100644 --- a/src/main/java/net/frozenorb/apiv3/route/users/GETUsersIdVerifyPassword.java +++ b/src/main/java/net/frozenorb/apiv3/route/users/GETUsersIdVerifyPassword.java @@ -24,7 +24,7 @@ public final class GETUsersIdVerifyPassword implements Handler { } 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) { diff --git a/src/main/java/net/frozenorb/apiv3/route/users/POSTUsersIdRegisterEmail.java b/src/main/java/net/frozenorb/apiv3/route/users/POSTUsersIdRegisterEmail.java index d1cc28c..c362403 100644 --- a/src/main/java/net/frozenorb/apiv3/route/users/POSTUsersIdRegisterEmail.java +++ b/src/main/java/net/frozenorb/apiv3/route/users/POSTUsersIdRegisterEmail.java @@ -50,7 +50,7 @@ public final class POSTUsersIdRegisterEmail implements Handler { return; } - User sameEmail = SyncUtils.runBlocking(v -> User.findByEmail(email, v)); + User sameEmail = SyncUtils.runBlocking(v -> User.findByConfirmedEmail(email, v)); if (sameEmail != null) { ErrorUtils.respondInvalidInput(ctx, email + " is already in use.");