Allow setting detectBrowserLanguage.cookieDomain
by runtimeConfig
#2761
Labels
detectBrowserLanguage.cookieDomain
by runtimeConfig
#2761
Describe the feature
Heyho
Currently we can specify the cookieDomain in the
nuxt.config.ts
to bake it into the NuxtI18nOptions, or leave it null so it defaults to the host.Problem
Sometimes, however, if it is used in several different deployments, it may be necessary to adapt the domain for the cookie accordingly. But right now, it is not possible to customise the domain for different deployments.
Solution
Introduce an environment variable, similar to baseUrl, to change the value for cookieDomain during runtime.
Suggestion:
NUXT_PUBLIC_I18N_COOKIE_DOMAIN
The icing on the cake would be that the option accepts a function with the context as a parameter that returns either the domain string or null.
Additional information
Final checks
The text was updated successfully, but these errors were encountered: