Преглед изворни кода

Changes GitHub scopes to include user access

main
Eric Amodio пре 2 година
родитељ
комит
54dce9481c
2 измењених фајлова са 4 додато и 2 уклоњено
  1. +1
    -1
      src/git/remotes/github.ts
  2. +3
    -1
      src/premium/github/githubGitProvider.ts

+ 1
- 1
src/git/remotes/github.ts Прегледај датотеку

@ -17,7 +17,7 @@ const issueEnricher3rdPartyRegex = /\b(?[^/\s]+\/[^/\s]+)\\#(?[0-9]+)
const fileRegex = /^\/([^/]+)\/([^/]+?)\/blob(.+)$/i;
const rangeRegex = /^L(\d+)(?:-L(\d+))?$/;
const authProvider = Object.freeze({ id: 'github', scopes: ['repo'] });
const authProvider = Object.freeze({ id: 'github', scopes: ['repo', 'read:user', 'user:email'] });
export class GitHubRemote extends RichRemoteProvider {
protected get authProvider() {

+ 3
- 1
src/premium/github/githubGitProvider.ts Прегледај датотеку

@ -87,6 +87,8 @@ import { getRemoteHubApi, GitHubAuthorityMetadata, Metadata, RemoteHubApi } from
const emptyPagedResult: PagedResult<any> = Object.freeze({ values: [] });
const emptyPromise: Promise<GitBlame | GitDiff | GitLog | undefined> = Promise.resolve(undefined);
const githubAuthenticationScopes = ['repo', 'read:user', 'user:email'];
// Since negative lookbehind isn't supported in all browsers, this leaves out the negative lookbehind condition `(?<!\.lock)` to ensure the branch name doesn't end with `.lock`
const validBranchOrTagRegex = /^[^/](?!.*\/\.)(?!.*\.\.)(?!.*\/\/)(?!.*@\{)[^\000-\037\177 ~^:?*[\\]+[^./]$/;
@ -2093,7 +2095,7 @@ export class GitHubGitProvider implements GitProvider, Disposable {
if (this._sessionPromise == null) {
async function getSession(): Promise<AuthenticationSession> {
try {
return await authentication.getSession('github', ['repo'], {
return await authentication.getSession('github', githubAuthenticationScopes, {
createIfNone: true,
});
} catch (ex) {

Loading…
Откажи
Сачувај