Skip to content

Commit

Permalink
Log error states for session issues
Browse files Browse the repository at this point in the history
Co-authored-by: Bethany Seeger <bseeger@codeforamerica.org>
Co-authored-by: Cypress Borg <cborg@codeforamerica.org>
Co-authored-by: Chibuisi Enyia <cenyia@codeforamerica.org>
  • Loading branch information
4 people committed Sep 25, 2023
1 parent b1af359 commit e232343
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ public boolean preHandle(HttpServletRequest request, @NotNull HttpServletRespons
}

if (session == null) {
log.error("No active session found for request to {}. Redirecting to landing page.", request.getRequestURI());
response.sendRedirect(redirect_url);
return false;
}

if (session.getAttribute("id") == null) {
log.error("A submission ID was not found in the session for request to {}. Redirecting to landing page.", request.getRequestURI());
response.sendRedirect(redirect_url);
return false;
}
Expand Down

0 comments on commit e232343

Please sign in to comment.