Skip to content

Native integrations auth flow

Warren Gifford requested to merge native-integrations-auth-flow into master

Created by: felixfbecker

Implements RFC 67 APPROVED: Authentication UI on Code Hosts, closes #8758 (closed), closes #6108 (closed)

I chose the "View on Sourcegraph" button as a start to show "Sign in to Sourcegraph" when not signed in, instead of just showing nothing. While the user is not signed in, extensions are already initialized with local client settings, but we cannot add any text documents yet if the file info requests failed with auth errors.

On a click, the sign in page is opened in a new tab. When the tab is closed again, settings are attempted to be fetched again, and any file content requests are retried. The integration instantly reacts to the signed in status and starts adding text documents.

We can add more places for the CTA, like a big alert, but that requires more changes to implement cross-code host on all pages. Regardless, this PR makes a lot of necessary changes to make the code reactive to sign in status in general.

I made it so that the sign in button would also be shown in the minimal UI, because Gitlab had asked for these CTAs too. Gitlab doesn't have the view repo on Sourcegraph button currently implemented though, this primarily targets Bitbucket right now.

Added snapshot tests for the sign in button.

2020-03-18 15 27 32

Merge request reports

Loading