From b23784f598fb430b26c3f6985dbee0b7e15fa715 Mon Sep 17 00:00:00 2001 From: Ludy Date: Fri, 23 Aug 2024 12:10:58 +0200 Subject: [PATCH] Fix: authentication ApiKey NullPointerException (#1744) --- .../software/SPDF/config/security/UserAuthenticationFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/stirling/software/SPDF/config/security/UserAuthenticationFilter.java b/src/main/java/stirling/software/SPDF/config/security/UserAuthenticationFilter.java index 10de4ea9..c3fe63b4 100644 --- a/src/main/java/stirling/software/SPDF/config/security/UserAuthenticationFilter.java +++ b/src/main/java/stirling/software/SPDF/config/security/UserAuthenticationFilter.java @@ -58,7 +58,7 @@ public class UserAuthenticationFilter extends OncePerRequestFilter { try { // Use API key to authenticate. This requires you to have an authentication // provider for API keys. - Optional user = userService.loadUserByApiKey(apiKey); + Optional user = userService.getUserByApiKey(apiKey); if (!user.isPresent()) { response.setStatus(HttpStatus.UNAUTHORIZED.value()); response.getWriter().write("Invalid API Key.");