Skip to content
This repository was archived by the owner on Dec 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ workflows:
context : org-global
filters:
branches:
only: [dev, 'feature/RS256-Auth0']
only: [dev, 'feature/api-call-optimization']
# Production build is executed on "master" branch only.
- "build-prod":
context : org-global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ public abstract class UserDAO implements DaoBase<User>, Transactional<UserDAO> {
)
public abstract List<User> findUsersByEmail(@Bind("email") String email);

@RegisterMapperFactory(TCBeanMapperFactory.class)
@SqlQuery(
"SELECT " + USER_COLUMNS + ", " +
"e.address AS email, e.status_id AS emailStatus " +
"FROM common_oltp.user AS u JOIN common_oltp.email AS e ON e.user_id = u.user_id " +
"WHERE e.address = :email"
)
public abstract List<User> findUsersByEmailCS(@Bind("email") String email);

@RegisterMapperFactory(TCBeanMapperFactory.class)
@SqlQuery(
"SELECT " + USER_COLUMNS + ", " +
Expand Down Expand Up @@ -356,6 +365,23 @@ public User findUserByEmail(String email) {
return users.get(0);
}

/**
*
* @param email - case sensitive search
* @return an user object or null
*/
public User findUserByEmailCS(String email) {
if(email==null || email.length()==0)
throw new IllegalArgumentException("email must be specified.");

List<User> users = findUsersByEmailCS(email);
if(users==null || users.size()==0)
return null;

// if found multiple, retuning first one
return users.get(0);
}

@Transaction(TransactionIsolationLevel.READ_COMMITTED)
public TCID register(User user) {
if(user==null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -776,8 +776,9 @@ public ApiResponse roles(
User user = null;
if (!Utils.isEmpty(handle)) {
user = userDao.findUserByHandle(handle);
} else{
user = userDao.findUserByEmail(email);
} else {
// email address - case sensitive - for auth0 sepecific
user = userDao.findUserByEmailCS(email);
}

if(user==null) {
Expand Down