Implementation for replacement of hardcoded API URLs with config-base…#2517
Closed
SongmingFan123 wants to merge 1 commit into
Closed
Implementation for replacement of hardcoded API URLs with config-base…#2517SongmingFan123 wants to merge 1 commit into
SongmingFan123 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR shifts hardcoded API URL values to centralized configuration, improving maintainability and flexibility.
- Replaced literal API URLs in authentication and API call logic with config constants.
- Removed duplicate authentication constants from authUtils while updating Auth0 provider configuration.
- Updated README.md to document environment variable usage.
Reviewed Changes
Copilot reviewed 7 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/hooks/useAuthenticatedFetch.js | Replaced hardcoded audience URL with a config constant. |
| src/config/index.js | Introduced config constants for API URLs and Auth settings. |
| src/auth/authUtils.js | Removed duplicate Auth0 configuration values. |
| src/auth/Auth0ProviderWithNavigate.jsx | Updated to use centralized config for Auth0 parameters. |
| src/api/call.js | Replaced hardcoded API URL with the API_URL config constant. |
| README.md | Added documentation for environment configuration. |
Files not reviewed (4)
- .env.development: Language not supported
- .env.example: Language not supported
- .env.production: Language not supported
- package.json: Language not supported
| fetchMethod = fetch, | ||
| ) { | ||
| return fetchMethod(POLICYENGINE_API + path, { | ||
| return fetchMethod(API_URL + path, { |
There was a problem hiding this comment.
[nitpick] Consider ensuring consistent slash usage when concatenating API_URL with path, as the API_URL and API_AUDIENCE values use different trailing slash conventions. A utility function or normalization could prevent potential URL concatenation issues.
Collaborator
|
Closing in favor of #2510. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.