提交 aa384477 编写于 作者: J Jackson Kearl

Trust all of github if you're signed in to github.

Closes vscode-internalbacklog/1492.
上级 fbec07ac
...@@ -196,11 +196,8 @@ export async function readTrustedDomains(accessor: ServicesAccessor) { ...@@ -196,11 +196,8 @@ export async function readTrustedDomains(accessor: ServicesAccessor) {
} catch (err) { } } catch (err) { }
const userDomains = const userDomains =
authenticationService.isAuthenticationProviderRegistered('github') authenticationService.isAuthenticationProviderRegistered('github') && ((await authenticationService.getSessions('github')) ?? []).length > 0
? ((await authenticationService.getSessions('github')) ?? []) ? [`https://github.com`]
.map(session => session.account.label)
.filter((v, i, a) => a.indexOf(v) === i)
.map(username => `https://github.com/${username}/`)
: []; : [];
const workspaceDomains = await getRemotes(fileService, textFileService, workspaceContextService); const workspaceDomains = await getRemotes(fileService, textFileService, workspaceContextService);
......
...@@ -63,7 +63,7 @@ function computeTrustedDomainContent(defaultTrustedDomains: string[], trustedDom ...@@ -63,7 +63,7 @@ function computeTrustedDomainContent(defaultTrustedDomains: string[], trustedDom
} }
if (userTrustedDomains.length) { if (userTrustedDomains.length) {
content += `//\n// Additionally, the following domains are trusted based on your current GitHub login:\n`; content += `//\n// Additionally, the following domains are trusted based on your logged-in Accounts:\n`;
userTrustedDomains.forEach(d => { userTrustedDomains.forEach(d => {
content += `// - "${d}"\n`; content += `// - "${d}"\n`;
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册