Skip to content

Commit

Permalink
Sign in failed: Error: No auth flow succeeded. (#6076)
Browse files Browse the repository at this point in the history
Fixes #6056
  • Loading branch information
alexr00 authored Jul 3, 2024
1 parent 51a27dc commit de7d264
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
8 changes: 8 additions & 0 deletions src/github/githubRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,14 @@ export class GitHubRepository implements vscode.Disposable {
return undefined;
}

async canGetProjectsNow(): Promise<boolean> {
let { schema } = await this.ensure();
if (schema.GetRepoProjects && schema.GetOrgProjects) {
return true;
}
return false;
}

async getOrgProjects(): Promise<IProject[]> {
Logger.debug(`Fetch org projects - enter`, GitHubRepository.ID);
let { query, remote, schema } = await this.ensure();
Expand Down
19 changes: 10 additions & 9 deletions src/issues/issueFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,16 @@ export async function extractMetadataFromFile(repositoriesManager: RepositoriesM
if (text.startsWith(PROJECTS)) {
const lines = text.split(/\r\n|\n/, 1);
if (lines.length === 1) {
const repoProjects = await folderManager.getAllProjects(repo);
projects = lines[0].substring(PROJECTS.length)
.split(',')
.map(value => {
value = value.trim();
return repoProjects.find(project => project.title === value);
})
.filter<IProject>((project): project is IProject => !!project);

if (await repo.canGetProjectsNow()) {
const repoProjects = await folderManager.getAllProjects(repo);
projects = lines[0].substring(PROJECTS.length)
.split(',')
.map(value => {
value = value.trim();
return repoProjects.find(project => project.title === value);
})
.filter<IProject>((project): project is IProject => !!project);
}
text = text.substring(lines[0].length).trim();
}
}
Expand Down

0 comments on commit de7d264

Please sign in to comment.