Fix: authentication ApiKey NullPointerException (#1744)

This commit is contained in:
Ludy 2024-08-23 12:10:58 +02:00 committed by GitHub
parent 90cbcde029
commit b23784f598
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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> user = userService.loadUserByApiKey(apiKey);
Optional<User> user = userService.getUserByApiKey(apiKey);
if (!user.isPresent()) {
response.setStatus(HttpStatus.UNAUTHORIZED.value());
response.getWriter().write("Invalid API Key.");