Skip to content

Commit a8aaadc

Browse files
author
Vladimir Kotal
committed
warn about missing user/userguid separately
1 parent 36c40bd commit a8aaadc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

plugins/UserPlugin/src/opengrok/auth/plugin/decoders/HeaderDecoder.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,15 @@ public User fromRequest(HttpServletRequest request) {
5454
timestamp = request.getHeader(OSSO_COOKIE_TIMESTAMP_HEADER);
5555
userguid = request.getHeader(OSSO_USER_GUID_HEADER);
5656

57-
if (username == null || userguid == null || username.isEmpty() || userguid.isEmpty()) {
57+
if (username == null || username.isEmpty()) {
5858
LOGGER.log(Level.WARNING,
59-
"Can not construct an user: username or userguid could not be extracted");
59+
"Can not construct an user: username could not be extracted");
60+
return null;
61+
}
62+
63+
if (userguid == null || userguid.isEmpty()) {
64+
LOGGER.log(Level.WARNING,
65+
"Can not construct an user: userguid could not be extracted");
6066
return null;
6167
}
6268

0 commit comments

Comments
 (0)