KEYCLOAK-18643 Generic Javascript failure in server and adapters test pipeline

This commit is contained in:
Martin Bartoš 2021-07-20 14:29:15 +02:00 committed by Pavel Drozd
parent 6b9040d18a
commit 036239a901
2 changed files with 13 additions and 7 deletions

View file

@ -213,6 +213,10 @@ public class Profile {
return !getInstance().disabledFeatures.contains(feature);
}
public static boolean isProduct() {
return getInstance().profile.equals(ProfileValue.PRODUCT);
}
private class Config {
private Properties properties;

View file

@ -49,7 +49,7 @@ public class DefaultThemeManager implements ThemeManager {
private final DefaultThemeManagerFactory factory;
private final KeycloakSession session;
private List<ThemeProvider> providers;
private String defaultTheme;
private final String defaultTheme;
public DefaultThemeManager(DefaultThemeManagerFactory factory, KeycloakSession session) {
this.factory = factory;
@ -64,11 +64,13 @@ public class DefaultThemeManager implements ThemeManager {
}
private String typeBasedDefault(Theme.Type type) {
boolean isProduct = Profile.isProduct();
if ((type == Theme.Type.ACCOUNT) && isAccount2Enabled()) {
return "keycloak.v2";
return isProduct ? "rh-sso.v2" : "keycloak.v2";
}
return "keycloak";
return isProduct ? "rh-sso" : "keycloak";
}
@Override
@ -94,9 +96,9 @@ public class DefaultThemeManager implements ThemeManager {
if (!isAccount2Enabled() && theme.getName().equals("keycloak.v2")) {
theme = loadTheme("keycloak", type);
}
if (!isAccount2Enabled() && theme.getName().equals("rhsso.v2")) {
theme = loadTheme("rhsso", type);
if (!isAccount2Enabled() && theme.getName().equals("rh-sso.v2")) {
theme = loadTheme("rh-sso", type);
}
return theme;