Conversation
|
💬 Discussion in Slack: #pr-review-cli-252-fix-gateway-domain-flag-not-working-for-non-enroll-method Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel. |
|
| Filename | Overview |
|---|---|
| packages/cmd/gateway.go | Domain resolution logic unified into a single early block (flag > stored domain > logged-in user domain), fixing the bug where the --domain flag was ignored for non-enrollment-method invocations; no URL validation is applied to the resolved domain before it is used for all outbound API calls. |
| packages/cmd/relay.go | Same domain-resolution refactor as gateway.go; --domain flag and stored/logged-in fallbacks are now resolved once at the top before any enrollment branch, and SaveDomain now unconditionally persists the resolved URL. |
Reviews (2): Last reviewed commit: "remove unnecessary enrollmentMethod chec..." | Re-trigger Greptile
|
Removed that check because some users may enroll once and then remove the enroll method flag. That way we'd need to check if the flag either exists OR they already have an enrollment token. That check isn't needed, because if the enrollment token exists then the storedDomain also exists 🤣 Therefore just checking if a storedDomain exists is the closest we can get to optimal logic |
|
@greptile re-review this pr |
Description 📣
Old enrollment method gateway commands such as:
Did not work.
The --domain flag never gets used, and when removed the logged in domain never gets used either. It's ALWAYS app.infisical.com.
This change makes it prioritize domains in the following order:
--domainflagThis fix makes domains work for both the old and new enrollment methods.
Type ✨
Tests 🛠️
# Here's some code block to paste some code snippets