Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/accounts: Do not prefill the dotcom URL in the Enterprise login field #6418

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions vscode/webviews/AuthPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import type { AuthStatus, CodyIDE, TelemetryRecorder } from '@sourcegraph/cody-shared'
import {
type AuthStatus,
type CodyIDE,
type TelemetryRecorder,
isDotCom,
} from '@sourcegraph/cody-shared'

import signInLogoSourcegraph from '../resources/sourcegraph-mark.svg'
import { type AuthMethod, isSourcegraphToken } from '../src/chat/protocol'
Expand Down Expand Up @@ -280,7 +285,7 @@ const ClientSignInForm: React.FC<ClientSignInFormProps> = memo(
isSubmitting: false,
showAuthError: false,
formData: {
endpoint: authStatus?.endpoint ?? '',
endpoint: authStatus && !isDotCom(authStatus) ? authStatus.endpoint : '',
accessToken: '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
endpoint: authStatus && !isDotCom(authStatus) ? authStatus.endpoint : '',
endpoint: authStatus && !isDotCom(authStatus) ? authStatus.endpoint : '',

If the user has just signed out of dotcom or have never signed in before, would the endpoint in their authstatus set to DotCom by default?

maybe we could also check if the user's available endpoints (endpoint history) contain dotcom or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user has just signed out of dotcom or have never signed in before, would the endpoint in their authstatus set to DotCom by default?

These two cases might be different, but in the completely new setup case we do default the endpoint to dotcom. Today we display https://sourcegraph.com and this is effective at suppressing it as a default. I have updated the test plan to cover the "new install" case (which I'm simulating with a new user data dir & profile temp.)

maybe we could also check if the user's available endpoints (endpoint history) contain dotcom or not?

Yeah, great idea. Let's do it in a follow up.

},
})
Expand Down
Loading