diff --git a/src/main/java/stirling/software/SPDF/controller/web/AccountWebController.java b/src/main/java/stirling/software/SPDF/controller/web/AccountWebController.java index a70ae211..73d2a0c4 100644 --- a/src/main/java/stirling/software/SPDF/controller/web/AccountWebController.java +++ b/src/main/java/stirling/software/SPDF/controller/web/AccountWebController.java @@ -43,6 +43,7 @@ public class AccountWebController { @GetMapping("/login") public String login(HttpServletRequest request, Model model, Authentication authentication) { + if (authentication != null && authentication.isAuthenticated()) { return "redirect:/"; } @@ -72,6 +73,10 @@ public class AccountWebController { } } } + // Remove any null keys/values from the providerList + providerList + .entrySet() + .removeIf(entry -> entry.getKey() == null || entry.getValue() == null); model.addAttribute("providerlist", providerList); model.addAttribute("loginMethod", applicationProperties.getSecurity().getLoginMethod());