nuxt-auth
nuxt-auth copied to clipboard
Load `baseURL` from runtime config
Describe the feature
I usually have my API base URL for external APIs in:
runtimeConfig: {
public: {
apiBaseUrl: 'https://my-awesome-backend.local'
}
},
and replicate it in nuxt-auth config
baseURL: process.env.NUXT_PUBLIC_API_BASE_URL ?? "https://my-awesome-backend.local",
But then I need the NUXT_PUBLIC_API_BASE_URL variable on build and runtime, which is a bit annoying.
Therefore, it would be awesome to specify a JSON pointer to runtime config like it's done for the access / refresh tokens.
How would you implement this?
No response
Additional information
- [X] Would you be willing to help implement this feature?
Provider
- [X] AuthJS
- [X] Local
- [X] Refresh
- [ ] New Provider
Maybe related to #797
You can now set baseURL using
runtimeConfig: {
public: {
auth: {
baseURL: 'https://example.com/your/base/url'
}
}
}
as well as via originEnvKey and auth.baseURL
Done in #913