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.");