Skip to content

Commit b495812

Browse files
authored
fix: fix login issue in VS Code Insiders (#966) (#968)
ogin issue on VS Code Insiders #968
1 parent 71264fa commit b495812

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/shared.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,15 @@ export enum SortingStrategy {
125125
export const PREMIUM_URL_CN = "https://leetcode.cn/premium-payment/?source=vscode";
126126
export const PREMIUM_URL_GLOBAL = "https://leetcode.com/subscribe/?ref=lp_pl&source=vscode";
127127

128+
const protocol = vscode.env.appName.includes('Insiders') ? "vscode-insiders" : "vscode"
129+
128130
export const urls = {
129131
// base urls
130132
base: "https://leetcode.com",
131133
graphql: "https://leetcode.com/graphql",
132134
userGraphql: "https://leetcode.com/graphql",
133135
login: "https://leetcode.com/accounts/login/",
134-
authLoginUrl: "https://leetcode.com/authorize-login/vscode/?path=leetcode.vscode-leetcode",
136+
authLoginUrl: `https://leetcode.com/authorize-login/${protocol}/?path=leetcode.vscode-leetcode`,
135137
};
136138

137139
export const urlsCn = {
@@ -140,7 +142,7 @@ export const urlsCn = {
140142
graphql: "https://leetcode.cn/graphql",
141143
userGraphql: "https://leetcode.cn/graphql/noj-go/",
142144
login: "https://leetcode.cn/accounts/login/",
143-
authLoginUrl: "https://leetcode.cn/authorize-login/vscode/?path=leetcode.vscode-leetcode",
145+
authLoginUrl: `https://leetcode.cn/authorize-login/${protocol}/?path=leetcode.vscode-leetcode`,
144146
};
145147

146148
export const getUrl = (key: string) => {

0 commit comments

Comments
 (0)