Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load baseURL from runtime config #878

Closed
4 of 5 tasks
cngJo opened this issue Aug 23, 2024 · 3 comments
Closed
4 of 5 tasks

Load baseURL from runtime config #878

cngJo opened this issue Aug 23, 2024 · 3 comments
Labels
enhancement An improvement that needs to be added

Comments

@cngJo
Copy link
Contributor

cngJo commented Aug 23, 2024

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

  • Would you be willing to help implement this feature?

Provider

  • AuthJS
  • Local
  • Refresh
  • New Provider
@cngJo cngJo added enhancement An improvement that needs to be added pending An issue waiting for triage labels Aug 23, 2024
@cngJo
Copy link
Contributor Author

cngJo commented Aug 23, 2024

Maybe related to #797

@phoenix-ru
Copy link
Collaborator

phoenix-ru commented Dec 12, 2024

You can now set baseURL using

runtimeConfig: {
  public: {
    auth: {
      baseURL: 'https://example.com/your/base/url'
    }
  }
}

as well as via originEnvKey and auth.baseURL

@phoenix-ru
Copy link
Collaborator

Done in #913

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement that needs to be added
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants