Update UserService.java

This commit is contained in:
Anthony Stirling
2025-02-21 10:18:04 +00:00
committed by GitHub
parent 505c4bd2a7
commit 6b06ea5f6c

View File

@@ -139,6 +139,9 @@ public class UserService implements UserServiceInterface {
User user =
findByUsernameIgnoreCase(username)
.orElseThrow(() -> new UsernameNotFoundException("User not found"));
if(user.getApiKey() == null || user.getApiKey().length() == 0) {
user = addApiKeyToUser(username);
}
return user.getApiKey();
}