Use buildHostAddress for seller invite registration_url to fix incorrect domain in invitation links #362
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.
Summary
This PR updates the default value for the
registration_urlin the seller invitation schema to use thebuildHostAddressutility. Previously, the invitation link always pointed to localhost, regardless of the deployment environment. With this change, the invitation link will correctly use the vendor panel domain as configured in environment variables or fallback defaults, ensuring that invited sellers receive a valid registration link for the appropriate environment.Key changes
Replaced hardcoded localhost registration_url with dynamic buildHostAddress(Hosts.VENDOR_PANEL, '/register').
Ensures invitation links are environment-aware and point to the correct vendor panel domain.
Alternative considered
A key advantage of this approach is that the backend maintains intrinsic knowledge of where invitation links should direct users, ensuring consistency and environment-awareness across all entry points. Supplying the registration_url directly in the inviteSeller call within the page component was also considered, but this would duplicate URL construction logic and increase the risk of inconsistencies. Centralising the default in the schema feels more robust and maintainable.