17143 adjsut switcher
This commit is contained in:
@@ -227,12 +227,15 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
preferredLocale = cookies.pedw_locale;
|
||||
}
|
||||
|
||||
// Strip the current locale from the URL path
|
||||
const pathWithoutLocale = ctx.resolvedUrl.replace(/^\/(cy|en)/, "");
|
||||
//console.log("==============================", pathWithoutLocale);
|
||||
|
||||
if (preferredLocale !== locale) {
|
||||
return {
|
||||
redirect: {
|
||||
destination: `/${preferredLocale}/myportal`,
|
||||
destination: `/${preferredLocale}${pathWithoutLocale}`,
|
||||
permanent: false,
|
||||
locale: preferredLocale,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user