Hi.
I'm trying to catch my secret value in a fetch method, can you tell me how to do that ?
Env vars works well but the secret env doesn't work.
I have tryed this in my index.vue :
async fetch ({ app, store, params, error, app: { $axios } }) {
...
const oauthPassword = app.$env.OAUTH_API_PASSWORD => is empty
const oauthPassword = this.$env.OAUTH_API_PASSWORD => is empty
const oauthUser = app.$env.OAUTH_API_USER => Catch the good env from my kubernetes secrets
...
}
Here is my nuxt.config.js :
modules: [
...
['nuxt-env', {
keys: [
{ key: 'OAUTH_CLIENT_ID', default: 'abcd' },
{ key: 'OAUTH_API_HOST', default: 'https://oauth.io/' },
{ key: 'OAUTH_API_USER', default: 'my_user' },
{ key: 'OAUTH_API_PASSWORD', secret: true }
]
}]
...
Thx a lot.
Hi.
I'm trying to catch my secret value in a fetch method, can you tell me how to do that ?
Env vars works well but the secret env doesn't work.
I have tryed this in my index.vue :
Here is my nuxt.config.js :
Thx a lot.