Skip to content

Commit cbad926

Browse files
authored
Merge pull request #1103 from Microsoft/rebornix/authbugfix
Fix login with token.
2 parents a7bec0b + 3f3899b commit cbad926

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/github/credentials.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class CredentialStore {
4040
if (!uriOrToken) { return; }
4141
try {
4242
const uri = vscode.Uri.parse(uriOrToken);
43-
if (!uri.scheme) { throw new Error; }
43+
if (!uri.scheme || uri.scheme === 'file') { throw new Error; }
4444
uriHandler.handleUri(uri);
4545
} catch (error) {
4646
// If it doesn't look like a URI, treat it as a token.
@@ -246,8 +246,11 @@ export class CredentialStore {
246246

247247
private didEndLogin(authority: string): void {
248248
const status = this._authenticationStatusBarItems.get(authority)!;
249-
status.text = `$(mark-github) Signed in to ${authority}`;
250-
status.command = undefined;
249+
250+
if (status) {
251+
status.text = `$(mark-github) Signed in to ${authority}`;
252+
status.command = undefined;
253+
}
251254
}
252255

253256
private async updateAuthenticationStatusBar(remote: Remote): Promise<void> {

0 commit comments

Comments
 (0)