Skip to content

The Unified and Autonomous Development Platform

Change user.isAnnonymous to user == null

steve16dd4deeffa8
diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/GitopWebApp.java b/gitop.web/src/main/java/com/pmease/gitop/web/GitopWebApp.java
index d34f960de9..6ac0c5229b 100644
--- a/gitop.web/src/main/java/com/pmease/gitop/web/GitopWebApp.java
+++ b/gitop.web/src/main/java/com/pmease/gitop/web/GitopWebApp.java
@@ -120,7 +120,7 @@ public class GitopWebApp extends AbstractWicketConfig {
if (ExceptionUtils.find(e, EntityNotFoundException.class) != null) {
return new RenderPageRequestHandler(new PageProvider(PageNotFoundPage.class));
} else if (ExceptionUtils.find(e, AccessDeniedException.class) != null) {
- if (User.getCurrent().isAnonymous()) {
+ if (User.getCurrent() == null) {
return new RenderPageRequestHandler(new PageProvider(LoginPage.class));
} else {
return new RenderPageRequestHandler(new PageProvider(AccessDeniedPage.class));
diff --git a/gitop.web/src/main/java/com/pmease/gitop/web/page/BasePage.java b/gitop.web/src/main/java/com/pmease/gitop/web/page/BasePage.java
index 5f97a93577..5304c78b86 100644
--- a/gitop.web/src/main/java/com/pmease/gitop/web/page/BasePage.java
+++ b/gitop.web/src/main/java/com/pmease/gitop/web/page/BasePage.java
@@ -185,7 +185,7 @@ public abstract class BasePage extends WebPage {
protected void onPageInitialize() {
if (!isPermitted()) {
- if (User.getCurrent().isAnonymous()) {
+ if (User.getCurrent() == null) {
throw new RestartResponseAtInterceptPageException(LoginPage.class);
} else {
throw new AccessDeniedException("Access denied");