Skip to content
Snippets Groups Projects

feat(vscode): Prompt to get an access token when authentication fails

Open Warren Gifford requested to merge github/fork/steverice/get-token into main

Created by: steverice

If connecting to the sourcegraph instance returns a 401, give the user two actions to take. The first will take the user to sourcegraph to create a new token, using the token callback flow added in #35826 if available. The second will open the workbench settings to allow the user to paste in a token.

This is particularly useful when distributing a sourcegraph.url setting as part of the workspace/repository to point to a private instance. Since the URL is already set, the user does not get the first-time setup view when activating the sourcegraph extension. Instead, they will get this error dialog:

Access Token Error

Test plan

  • Ran existing unit tests with yarn test
  • Ran existing integration tests with yarn test-integration
  • Walked through the flow of installing the vscode extension in a fresh instance with no settings, with a URL and token already set, with only a URL set, against both sourcegraph.com and a private instance

Merge request reports

Pipeline #14 failed

Pipeline failed on github/fork/steverice/get-token

The source branch github/fork/steverice/get-token does not exist. Please restore it or use a different source branch.
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading