提交 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) {
} catch (err) { }
const userDomains =
authenticationService.isAuthenticationProviderRegistered('github')
? ((await authenticationService.getSessions('github')) ?? [])
.map(session => session.account.label)
.filter((v, i, a) => a.indexOf(v) === i)
.map(username => `https://github.com/${username}/`)
authenticationService.isAuthenticationProviderRegistered('github') && ((await authenticationService.getSessions('github')) ?? []).length > 0
? [`https://github.com`]
: [];
const workspaceDomains = await getRemotes(fileService, textFileService, workspaceContextService);
......
......@@ -63,7 +63,7 @@ function computeTrustedDomainContent(defaultTrustedDomains: string[], trustedDom
}
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 => {
content += `// - "${d}"\n`;
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册