Merge "Add support for ${path} in auth.switch_account_url"

This commit is contained in:
Dave Borowitz
2017-03-24 22:11:09 +00:00
committed by Gerrit Code Review
4 changed files with 89 additions and 10 deletions

View File

@@ -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 {