diff --git a/src/main/java/net/teumteum/alert/app/AlertHandler.java b/src/main/java/net/teumteum/alert/app/AlertHandler.java index 86e6bc6..56b6400 100644 --- a/src/main/java/net/teumteum/alert/app/AlertHandler.java +++ b/src/main/java/net/teumteum/alert/app/AlertHandler.java @@ -45,7 +45,7 @@ public void handleBeforeMeetingAlerts(BeforeMeetingAlerted alerted) { @Async(ALERT_EXECUTOR) @EventListener(EndMeetingAlerted.class) - public void handleEndMeetingAlerts(EndMeetingAlerted alerted) { + public void handleStartMeetingAlerts(EndMeetingAlerted alerted) { userAlertService.findAllByUserId(alerted.userIds()) .stream() .map(userAlert -> Pair.of(userAlert.getToken(), @@ -64,7 +64,7 @@ private String toCommaString(List ids) { for (int i = 0; i < ids.size() - 1; i++) { stringBuilder.append(ids.get(i)).append(","); } - stringBuilder.append(ids.get(ids.size() - 1)); + stringBuilder.append(ids.getLast()); return stringBuilder.toString(); } diff --git a/src/main/java/net/teumteum/core/security/filter/JwtAuthenticationFilter.java b/src/main/java/net/teumteum/core/security/filter/JwtAuthenticationFilter.java index 20ef8e3..36e960d 100644 --- a/src/main/java/net/teumteum/core/security/filter/JwtAuthenticationFilter.java +++ b/src/main/java/net/teumteum/core/security/filter/JwtAuthenticationFilter.java @@ -72,7 +72,7 @@ private void saveUserAuthentication(User user) { private String resolveTokenFromRequest(HttpServletRequest request) { String token = request.getHeader(jwtProperty.getAccess().getHeader()); - if (token.toLowerCase().startsWith(jwtProperty.getBearer().toLowerCase())) { + if (StringUtils.hasText(token) && token.toLowerCase().startsWith(jwtProperty.getBearer().toLowerCase())) { return token.substring(7); } return null;