sidebase / nuxt-auth

Authentication built for Nuxt 3! Easily add authentication via OAuth providers, credentials or Email Magic URLs!
https://auth.sidebase.io
MIT License
1.29k stars 163 forks source link

Load `baseURL` from runtime config #878

Open cngJo opened 2 months ago

cngJo commented 2 months ago

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

Provider

cngJo commented 2 months ago

Maybe related to #797