backend-api поправил стук при анонимном пользователе
This commit is contained in:
parent
d9e0a4ada2
commit
7f400066b9
1 changed files with 1 additions and 1 deletions
|
|
@ -68,7 +68,7 @@ public class UserController extends AbstractQueueController {
|
|||
UserIdResponse response = new UserIdResponse();
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
String username = KeycloakUtils.getUserNameFromAuthentication(authentication);
|
||||
User user = userImdg.getFirstObjectByFieldValues(Map.of("identifier", username));
|
||||
User user = username == null ? null : userImdg.getFirstObjectByFieldValues(Map.of("identifier", username));
|
||||
if (user == null) {
|
||||
log.info("getId user {} authenticated, but User object was not created", username);
|
||||
throw new IllegalStateException("couldn't return user id");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue