From cd15a27ad5874cec6aa13dcda6a5f9421e36441c Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 19 Feb 2024 11:36:50 +0800 Subject: [PATCH] call iAmSmart api with local --- src/pages/authentication/RegisterCustom.js | 5 +++-- src/pages/authentication/auth-forms/AuthLoginCustom.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/authentication/RegisterCustom.js b/src/pages/authentication/RegisterCustom.js index 079505c..54d27fb 100644 --- a/src/pages/authentication/RegisterCustom.js +++ b/src/pages/authentication/RegisterCustom.js @@ -20,6 +20,7 @@ const RegisterCustom = () => { const [isPopUp, setIsPopUp] = React.useState(false); const intl = useIntl(); + const { locale } = intl; const registerWithIAmSmart = () => { setIsPopUp(true); @@ -41,7 +42,7 @@ const RegisterCustom = () => { +"&source=" + getBowserType() +"&redirectURI="+encodeURIComponent(callbackUrl) +"&scope="+encodeURIComponent("eidapi_auth eidapi_profiles") - +"&lang=zh-HK"//en-US, zh-HK, or zh-CN + +"&lang="+(locale === 'en' ?"en-US":locale === 'zh-HK' ?"zh-HK":"zh-CN") //+"&state=" +"&brokerPage=false" window.location.assign(url); @@ -55,7 +56,7 @@ const RegisterCustom = () => { +"&source=" + getBowserType() +"&redirectURI="+encodeURIComponent(callbackUrl) +"&scope="+encodeURIComponent("eidapi_auth eidapi_profiles") - +"&lang=zh-HK"//en-US, zh-HK, or zh-CN + +"&lang="+(locale === 'en' ?"en-US":locale === 'zh-HK' ?"zh-HK":"zh-CN") //+"&state=" +"&brokerPage=true" window.location.assign(url); diff --git a/src/pages/authentication/auth-forms/AuthLoginCustom.js b/src/pages/authentication/auth-forms/AuthLoginCustom.js index bdf32ba..5b9bd00 100644 --- a/src/pages/authentication/auth-forms/AuthLoginCustom.js +++ b/src/pages/authentication/auth-forms/AuthLoginCustom.js @@ -205,7 +205,7 @@ const AuthLoginCustom = () => { + "&source=" + getBowserType() + "&redirectURI=" + encodeURIComponent(callbackUrl) + "&scope=" + encodeURIComponent("eidapi_auth eidapi_profiles") - + "&lang=zh-HK"//en-US, zh-HK, or zh-CN + +"&lang="+(locale === 'en' ?"en-US":locale === 'zh-HK' ?"zh-HK":"zh-CN") //+"&state=" + "&brokerPage=false" window.location=url; @@ -237,7 +237,7 @@ const AuthLoginCustom = () => { + "&source=" + getBowserType() + "&redirectURI=" + encodeURIComponent(callbackUrl) + "&scope=" + encodeURIComponent("eidapi_auth eidapi_profiles") - + "&lang=zh-HK"//en-US, zh-HK, or zh-CN + +"&lang="+(locale === 'en' ?"en-US":locale === 'zh-HK' ?"zh-HK":"zh-CN") //+"&state=" + "&brokerPage=true" window.location=url;