Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix/accounts: Do not prefill the dotcom URL in the Enterprise login f…
…ield (#6418) When you last logged into dot com, we pre-fill the enterprise login URL with https://sourcegraph.com. This is contrary to our efforts to get Enterprise users to log into the right endpoint. You can still log in to dot com using the handy enterprise login method/hack. We just won't prefill that URL. Fixes CODY-4534. ## Test plan 1. Sign out of all your accounts. 2. Sign in to dotcom. This works with social login buttons or signing into https://sourcegraph.com as an "Enterprise" URL. 3. Go to https://sourcegraph.com/user/settings/tokens and delete the token you are using. 4. Reload VSCode, or wait for it to log you out. 5. Go to sign in to an enterprise account. Verify that the URL field has a placeholder like https://instance. and NOT https://sourcegraph.com 6. Sign in to s2. 7. Go to https://sourcegraph.sourcegraph.com/user/settings/tokens and delete the token you are using. 8. Reload VSCode, or wait for it to log you out. 9. Go to sign in to an enterprise account. Verify that the URL field is prefilled with https://sourcegraph.sourcegraph.com 10. Run a new instance of VSCode with `--user-data-dir=/tmp/foo --profile-temp` to simulate a fresh install. 11. Go to sign in to an enterprise account. Verify that the URL field has a placeholder like https://instance. and NOT https://sourcegraph.com Note, if you sign out (cmd-shift-p Cody: Sign Out) etc. then the field is *not* prefilled, we delete the record of that account. It is new installs, or when accounts are left over from expired tokens, that you get the prefilling. Note: This is not easily e2e testable because Cody Web has fixed the dotcom override URL in the vite config, which is a compile-time static. To make this testable we would need to configure the dotcom override URL as the webview boots up. This is a big job because DOTCOM_URL is a module-level constant, etc.
- Loading branch information