diff --git a/src/features/AuthServiceApp/index.tsx b/src/features/AuthServiceApp/index.tsx index bb07e029..5e2028da 100644 --- a/src/features/AuthServiceApp/index.tsx +++ b/src/features/AuthServiceApp/index.tsx @@ -17,7 +17,7 @@ setClientTitleAndDescription(client.title, client.description) setClientIcons(client.name) const Background = client.background -const initialLanguage = getLanguageUrlParam() || client.defaultLanguage +const initialLanguage = getLanguageUrlParam() const AuthServiceApp = () => ( diff --git a/src/helpers/languageUrlParam/index.tsx b/src/helpers/languageUrlParam/index.tsx index 50fb0d3c..a3e7aa6f 100644 --- a/src/helpers/languageUrlParam/index.tsx +++ b/src/helpers/languageUrlParam/index.tsx @@ -1,10 +1,13 @@ +import isNull from 'lodash/isNull' + import { history } from 'config/history' +import { client } from 'config/clients' const KEY = 'lang' export const getLanguageUrlParam = () => { const lang = new URLSearchParams(history.location.search).get(KEY) - return lang || undefined + return (lang !== 'null' && !isNull(lang)) ? lang : client.defaultLanguage } export const addLanguageUrlParam = (lang: string, url: string) => {