web: prioritise ?locale parameter over saved locale

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2022-02-26 16:17:04 +01:00
parent 2f8dbe9b97
commit 2c54be85be
2 changed files with 12 additions and 4 deletions

View File

@ -1,5 +1,5 @@
import { CoreApi, SessionUser } from "@goauthentik/api";
import { i18n } from "@lingui/core";
import { activateLocale } from "../interfaces/locale";
import { DEFAULT_CONFIG } from "./Config";
let globalMePromise: Promise<SessionUser>;
@ -12,7 +12,7 @@ export function me(): Promise<SessionUser> {
const locale = user.user.settings.locale;
if (locale && locale !== "") {
console.debug(`authentik/locale: Activating user's configured locale '${locale}'`);
i18n.activate(locale);
activateLocale(locale);
}
return user;
}).catch((ex) => {