File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
personalization-service/src/main/java/de/muenchen/dbs/personalization/checklist Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -79,12 +79,9 @@ private Checklist getChecklistOrThrowException(final UUID checklistId) {
79
79
private String getUserMailFromAuthenticationOrThrow () {
80
80
final Authentication authentication = SecurityContextHolder .getContext ().getAuthentication ();
81
81
if (authentication .getPrincipal () instanceof Jwt jwt ) {
82
- Object emailClaim = jwt .getClaims ().get ("email" );
83
- if (emailClaim != null ) {
84
- final String email = emailClaim .toString ();
85
- if (!StringUtils .isBlank (email )) {
86
- return email ;
87
- }
82
+ final Object emailClaim = jwt .getClaims ().get ("email" );
83
+ if (emailClaim != null && !StringUtils .isBlank (emailClaim .toString ())) {
84
+ return emailClaim .toString ();
88
85
}
89
86
}
90
87
throw new ResponseStatusException (HttpStatus .UNAUTHORIZED );
You can’t perform that action at this time.
0 commit comments