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

enh(#797): Determine if baseUrl is external and properly handle internal requests #856

Closed
wants to merge 13 commits into from

Conversation

zoey-kaiser
Copy link
Member

@zoey-kaiser zoey-kaiser commented Aug 9, 2024

πŸ”— Linked issue

closes #797

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR adds a check to determine if the provided baseUrl config entry is an external or internal API route. This check is done by:

    1. If the baseURL includes a host
    • If not, then the baseURL is assumed to be an internal Nuxt route
    1. if the baseURL host matches the host of the current event.req
    • If a host was added that matches the URL of the application, then requests are handled as internal requests

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.

@zoey-kaiser zoey-kaiser added the enhancement An improvement that needs to be added label Aug 10, 2024
Copy link

pkg-pr-new bot commented Aug 25, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/@sidebase/nuxt-auth@856

commit: a79cd9b

@zoey-kaiser
Copy link
Member Author

Closing in favour of #913

@zoey-kaiser zoey-kaiser deleted the 797/improve-base-url-detection branch September 18, 2024 18:43
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 this pull request may close these issues.

RFC: Improve the handing of baseURL to be more intuitive
2 participants