Skip to content

Commit

Permalink
[ALS-4791] Ensure PSAMA works for Open and Auth (#140)
Browse files Browse the repository at this point in the history
[ALS-4791] Revert catch block changes to findBySubject
  • Loading branch information
Gcolon021 authored Oct 17, 2023
1 parent 18e1e4d commit 85881f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,14 @@ protected UserRepository() {
}

public User findBySubject(String subject) {
try {
CriteriaQuery<User> query = em.getCriteriaBuilder().createQuery(User.class);
Root<User> queryRoot = query.from(User.class);
query.select(queryRoot);
CriteriaBuilder cb = cb();
return em.createQuery(query
.where(
eq(cb, queryRoot, "subject", subject)))
.getSingleResult();
} catch (NoResultException e) {
return null;
}
CriteriaQuery<User> query = em.getCriteriaBuilder().createQuery(User.class);
Root<User> queryRoot = query.from(User.class);
query.select(queryRoot);
CriteriaBuilder cb = cb();
return em.createQuery(query
.where(
eq(cb, queryRoot, "subject", subject)))
.getSingleResult();
}

public User findBySubjectAndConnection(String subject, String connectionId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@Produces("application/json")
public class AuthService {

private Logger logger = LoggerFactory.getLogger(this.getClass());
private final Logger logger = LoggerFactory.getLogger(this.getClass());

@Inject
AuthenticationService authenticationService;
Expand Down

0 comments on commit 85881f5

Please sign in to comment.