Runtime configuration of auth module #1652
Unanswered
Busserull75
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to configure the auth module in nuxt.config.js based on environment variables in a staging/production-environment? It works fine on local machine, but not in staging or production and the values are set to "undefined". This is in a CI/CD-pipeline environment where the application is built once and deployed to the different environments. It seems that the auth module configuration is set during buildtime and not runtime. If it was set runtime it would have worked based on the environment variables which are set in each runtime environment. Other parts of the nuxt.config.js are set at runtime as they also use "process.env.variablename" and they are set correct at runtime.
I need to deploy the the same build in multiple environments (production, staging etc) but each deploy must have a different auth module configuration in the nuxt.config.js file based on environment variables.
https://auth.nuxtjs.org/schemes/oauth2#options
Example:
I need to configure these endpoints differently in my staging and production environment based on the ENDPOINT_VARIABLE environment variable.
I see there have been other discussions related to this, but I didnt find a working solution on this.
#1597
nuxt/nuxt#5100
Beta Was this translation helpful? Give feedback.
All reactions