Make auth callback URL relative to base API_URL #6938
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.



What type of PR is this? (check all applicable)
Describe this PR
This is a tweak to the changes made in #6933. That PR works correctly AFAIK for tasks.hotosm.org's use case, but I discovered when backporting the fix to osmus/tasking-manager (which powers tasks.openstreetmap.us and tasks.teachosm.org) that it does not work if the backend is deployed to a nonstandard URL path.
This change makes the callback URL string a relative path (removing the hardcoded
/api/v2prefix). The appropriate prefix will then be prepended infetchLocalJSONAPI()when the string is converted to aURLobject. This prefix may be/api/v2or it may be another value depending on the configuration environment variables provided at runtime.This change is running in production on tasks.openstreetmap.us and tasks.teachosm.org already, so I am fairly confident that it works.