Add support for ${path} in auth.switch_account_url
Provide client-side interpolation of ${path} in this string when
generating the "Switch account" link.
This change also updates the GWT version of this link to simply
remove any ${path} elements. There doesn't seem to be a good way
to ensure the path would be updated as the location changes.
Bug: Issue 4884
Change-Id: I2070208b540efb3f9fb527e23dbbd220fc2d2dce
This commit is contained in:
@@ -52,8 +52,9 @@ public class UserPopupPanel extends PopupPanel {
|
||||
userEmail.setText(account.email());
|
||||
}
|
||||
if (showSettingsLink) {
|
||||
if (Gerrit.info().auth().switchAccountUrl() != null) {
|
||||
switchAccount.setHref(Gerrit.info().auth().switchAccountUrl());
|
||||
String switchAccountUrl = Gerrit.info().auth().switchAccountUrl();
|
||||
if (switchAccountUrl != null) {
|
||||
switchAccount.setHref(switchAccountUrl.replace("${path}", "/"));
|
||||
} else if (Gerrit.info().auth().isDev() || Gerrit.info().auth().isOpenId()) {
|
||||
switchAccount.setHref(Gerrit.selfRedirect("/login"));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user