Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
[BZ 1089789] - Login Broken for GWT Dev Mode - Fixing the new login p…
Browse files Browse the repository at this point in the history
…age for GWT development mode.
  • Loading branch information
jkremser committed Apr 22, 2014
1 parent 1bc9904 commit 769bb64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public class LoginView extends Canvas {
private static final String ERROR_FEEDBACK_DIV_ID = "errorFeedback";
private static final String HTML_ID = "htmlId";
private String errorMessage;
private static volatile boolean isLoginView = true;

private ProductInfo productInfo;

Expand All @@ -146,7 +147,7 @@ public void showLoginDialog() {
redirectTo(LOGIN_VIEW);
return;
}

isLoginView = true;
loginShowing = true;
form = new DynamicForm();
form.setMargin(25);
Expand Down Expand Up @@ -673,12 +674,15 @@ private native void injectLoginFunction(LoginView view) /*-{
}-*/;

public static boolean isLoginView() {
return com.google.gwt.user.client.Window.Location.getHref().contains(LOGIN_VIEW);
return isLoginView && com.google.gwt.user.client.Window.Location.getHref().contains(LOGIN_VIEW);
}

public static void redirectTo(String path) {
if (path != null && !("/coregui/" + path).equals(com.google.gwt.user.client.Window.Location.getPath())) {
com.google.gwt.user.client.Window.Location.replace(GWT.getHostPageBaseURL() + path
if (path.isEmpty()) {
isLoginView = false;
}
com.google.gwt.user.client.Window.Location.assign(GWT.getHostPageBaseURL() + path
+ com.google.gwt.user.client.Window.Location.getQueryString()
+ com.google.gwt.user.client.Window.Location.getHash());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ public void onSuccess(String result) {
sessionTimeout = SESSION_TIMEOUT_MINIMUM;
}

refresh();
LoginView.redirectTo(""); // redirect back to the "root" path (coregui/)
}

Expand Down

0 comments on commit 769bb64

Please sign in to comment.