Skip to content

Commit

Permalink
convert admin email to lowercase before validation
Browse files Browse the repository at this point in the history
  • Loading branch information
jgunnCO committed Apr 30, 2024
1 parent 56ab46e commit 2d5e7bf
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ public ResponseEntity<String> updateFundingOrganisation(@RequestBody UpdateFundi
@PreAuthorize("hasRole('SUPER_ADMIN')")
public ResponseEntity<Void> checkNewAdminEmailIsValid(
@RequestBody @Valid final CheckNewAdminEmailDto checkNewAdminEmailDto, final HttpServletRequest request) {
if (checkNewAdminEmailDto.getEmailAddress().equals(checkNewAdminEmailDto.getOldEmailAddress())) {
// the email we store comes from One Login, which will always convert the value the user entered to lowercase
if (checkNewAdminEmailDto.getEmailAddress().toLowerCase().equals(checkNewAdminEmailDto.getOldEmailAddress())) {
throw new FieldViolationException("emailAddress", "This user already owns this grant.");
}

Expand Down

0 comments on commit 2d5e7bf

Please sign in to comment.