mirror of
				https://github.com/Frooodle/Stirling-PDF.git
				synced 2025-11-01 01:21:18 +01:00 
			
		
		
		
	Fix: authentication ApiKey NullPointerException (#1744)
This commit is contained in:
		
							parent
							
								
									90cbcde029
								
							
						
					
					
						commit
						b23784f598
					
				@ -58,7 +58,7 @@ public class UserAuthenticationFilter extends OncePerRequestFilter {
 | 
				
			|||||||
                try {
 | 
					                try {
 | 
				
			||||||
                    // Use API key to authenticate. This requires you to have an authentication
 | 
					                    // Use API key to authenticate. This requires you to have an authentication
 | 
				
			||||||
                    // provider for API keys.
 | 
					                    // provider for API keys.
 | 
				
			||||||
                    Optional<User> user = userService.loadUserByApiKey(apiKey);
 | 
					                    Optional<User> user = userService.getUserByApiKey(apiKey);
 | 
				
			||||||
                    if (!user.isPresent()) {
 | 
					                    if (!user.isPresent()) {
 | 
				
			||||||
                        response.setStatus(HttpStatus.UNAUTHORIZED.value());
 | 
					                        response.setStatus(HttpStatus.UNAUTHORIZED.value());
 | 
				
			||||||
                        response.getWriter().write("Invalid API Key.");
 | 
					                        response.getWriter().write("Invalid API Key.");
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user