Skip to content

Commit cb5c009

Browse files
committed
Get login from session account
1 parent c8dc28b commit cb5c009

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

src/git/repository.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import * as vscode from "vscode";
22
import {Octokit} from "@octokit/rest";
33

44
import {handleSamlError} from "../api/handleSamlError";
5+
import {getSession} from "../auth/auth";
56
import {getRemoteName} from "../configuration/configuration";
67
import {Protocol} from "../external/protocol";
78
import {logDebug, logError} from "../log";
89
import {API, GitExtension, RefType, RepositoryState} from "../typings/git";
910
import {canReachGitHubAPI} from "../util";
10-
import {getUsername} from "./username";
1111
import {RepositoryPermission, getRepositoryPermission} from "./repository-permissions";
1212

1313
interface GitHubUrls {
@@ -162,9 +162,8 @@ export async function getGitHubContext(): Promise<GitHubContext | undefined> {
162162

163163
logDebug("Found protocol infos", protocolInfos.length.toString());
164164

165-
const username = await handleSamlError(async (client: Octokit) => {
166-
return getUsername(client);
167-
});
165+
const session = await getSession();
166+
const username = session.account.label;
168167

169168
const repos = await handleSamlError(async (client: Octokit) => {
170169
return await Promise.all(

src/git/username.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)