I'm trying to figure out how to utilize a .env value in nuxt.config.js using runtime config.
It's easy to declare and use it in regular code.
publicRuntimeConfig: {
URL_API: process.env.URL_API || 'http://localhost:8000/',
},
However, I want to use the .env value like this in my nuxt.config.js:
auth: {
strategies: {
local: {
token: {
property: 'token',
required: true,
maxAge: 1000 * 60 * 60
},
user: {
property: 'user',
autoFetch: false
},
clientID: true,
endpoints: {
login: { url: `${process.env.URL_API}/auth/login`, method: 'post' },
logout: { url: `${process.env.URL_API}/auth/logout`, method: 'post' },
},
tokenType: ''
}
},
redirect: {
login: '/auth/login',
logout: '/',
callback: '/auth/login',
home: '/'
}
},
Any suggestions on how to achieve this?