This PR aims to make strategies configurable at runtime. It adjusts the plugin template to merge the static strategy configuration from nuxt.config.ts with optional strategy configuration from the public runtime config.
This would now allow you to configure things like the clientId for strategy myStrategy with an environment variable called NUXT_PUBLIC_AUTH_STRATEGIES_MY_STRATEGY_CLIENT_ID.
You can also adjust things like the configuration endpoint with this approach.
This is particularly useful for deployments where you need to change the client id depending on the environment. Development, Staging and Production environments would now be easily configurable by changing the .env file or environment.
This PR aims to make strategies configurable at runtime. It adjusts the plugin template to merge the static strategy configuration from
nuxt.config.ts
with optional strategy configuration from the public runtime config.Assuming the following nuxt.config.ts file:
This would now allow you to configure things like the
clientId
for strategymyStrategy
with an environment variable calledNUXT_PUBLIC_AUTH_STRATEGIES_MY_STRATEGY_CLIENT_ID
.You can also adjust things like the configuration endpoint with this approach.
This is particularly useful for deployments where you need to change the client id depending on the environment. Development, Staging and Production environments would now be easily configurable by changing the
.env
file or environment.This PR resolves https://github.com/nuxt-alt/auth/issues/2