Skip to content
This repository was archived by the owner on Dec 9, 2025. It is now read-only.

Commit b3bebab

Browse files
authored
Merge pull request #86 from appirio-tech/dev
fix email check
2 parents 7ead25c + 6d0f180 commit b3bebab

File tree

1 file changed

+2
-2
lines changed
  • src/main/java/com/appirio/tech/core/service/identity/dao

1 file changed

+2
-2
lines changed

src/main/java/com/appirio/tech/core/service/identity/dao/UserDAO.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public abstract class UserDAO implements DaoBase<User>, Transactional<UserDAO> {
138138
public abstract List<User> findUsersByEmail(@Bind("email") String email);
139139

140140
@SqlQuery("SELECT COUNT(e2.email_id) " +
141-
"FROM common_oltp.user AS u LEFT JOIN common_oltp.email AS e ON e.user_id = u.user_id " +
141+
"FROM common_oltp.user AS u LEFT JOIN common_oltp.email AS e ON e.user_id = u.user_id AND e.email_type_id = 1 AND e.primary_ind = 1 " +
142142
"LEFT JOIN common_oltp.email AS e2 ON LOWER(e2.address) = LOWER(e.address) " +
143143
"WHERE u.user_id = :userId")
144144
public abstract int getEmailCount(@Bind("userId") long userId);
@@ -147,7 +147,7 @@ public abstract class UserDAO implements DaoBase<User>, Transactional<UserDAO> {
147147
@SqlQuery(
148148
"SELECT mfa.id AS id, u.user_id AS userId, u.handle AS handle, u.first_name AS firstName, e.address AS email, mfa.mfa_enabled AS mfaEnabled, mfa.dice_enabled AS diceEnabled" +
149149
", dc.id AS diceConnectionId, dc.connection AS diceConnection, dc.accepted AS diceConnectionAccepted, dc.created_at AS diceConnectionCreatedAt " +
150-
"FROM common_oltp.user AS u LEFT JOIN common_oltp.email AS e ON e.user_id = u.user_id " +
150+
"FROM common_oltp.user AS u LEFT JOIN common_oltp.email AS e ON e.user_id = u.user_id AND e.email_type_id = 1 AND e.primary_ind = 1 " +
151151
"LEFT JOIN common_oltp.user_2fa AS mfa ON mfa.user_id = u.user_id " +
152152
"LEFT JOIN common_oltp.dice_connection AS dc ON dc.user_id = u.user_id " +
153153
"WHERE u.user_id = :userId")

0 commit comments

Comments
 (0)