KEYCLOAK-2576 KEYCLOAK-2576

Changing locale on login screen doesn't affect current user
This commit is contained in:
Stian Thorgersen 2016-03-03 07:06:10 +01:00
parent 45b940ad2d
commit 13b6c6f507

View file

@ -61,16 +61,6 @@ public class LocaleHelper {
}
}
// User profile
if (user != null && user.getAttributes().containsKey(UserModel.LOCALE)) {
String localeString = user.getFirstAttribute(UserModel.LOCALE);
Locale locale = findLocale(realm.getSupportedLocales(), localeString);
if (locale != null) {
updateLocaleCookie(session, realm, localeString);
return locale;
}
}
// Locale cookie
if (httpHeaders != null && httpHeaders.getCookies().containsKey(LOCALE_COOKIE)) {
String localeString = httpHeaders.getCookies().get(LOCALE_COOKIE).getValue();
@ -83,6 +73,16 @@ public class LocaleHelper {
}
}
// User profile
if (user != null && user.getAttributes().containsKey(UserModel.LOCALE)) {
String localeString = user.getFirstAttribute(UserModel.LOCALE);
Locale locale = findLocale(realm.getSupportedLocales(), localeString);
if (locale != null) {
updateLocaleCookie(session, realm, localeString);
return locale;
}
}
// ui_locales query parameter
if (uriInfo != null && uriInfo.getQueryParameters().containsKey(UI_LOCALES_PARAM)) {
String localeString = uriInfo.getQueryParameters().getFirst(UI_LOCALES_PARAM);