diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/push/UpdateErrorHandler.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/push/UpdateErrorHandler.java index 368a4d686..8ceb39e66 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/push/UpdateErrorHandler.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/push/UpdateErrorHandler.java @@ -54,7 +54,7 @@ private boolean checkUserSession() { this.pageService.getI18nSupport()); logoutSuccess.open(null); } catch (final Exception ee) { - log.warn("Unable to auto-logout: ", ee.getMessage()); + log.warn("Unable to auto-logout: {}", ee.getMessage()); } return false; } diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/auth/OAuth2AuthorizationContextHolder.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/auth/OAuth2AuthorizationContextHolder.java index f7486f6e3..945ac620e 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/auth/OAuth2AuthorizationContextHolder.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/remote/webservice/auth/OAuth2AuthorizationContextHolder.java @@ -192,13 +192,16 @@ public boolean isValid() { public boolean isLoggedIn() { final OAuth2AccessToken accessToken = this.restTemplate.getOAuth2ClientContext().getAccessToken(); if (accessToken == null || StringUtils.isEmpty(accessToken.toString())) { + log.warn("No Access Token for user: {}", this.restTemplate.getOAuth2ClientContext().getAccessTokenRequest().getHeaders()); return false; } try { final ResponseEntity forEntity = this.restTemplate.getForEntity(this.currentUserURI, String.class); + if (forEntity.getStatusCode() != HttpStatus.OK) { + log.warn("Failed to verify user login on webservice: {}", forEntity.getBody()); return false; } } catch (final Exception e) {