diff --git a/src/shared.ts b/src/shared.ts index 8c6a825..2301f7f 100644 --- a/src/shared.ts +++ b/src/shared.ts @@ -125,13 +125,15 @@ export enum SortingStrategy { export const PREMIUM_URL_CN = "https://leetcode.cn/premium-payment/?source=vscode"; export const PREMIUM_URL_GLOBAL = "https://leetcode.com/subscribe/?ref=lp_pl&source=vscode"; +const protocol = vscode.env.appName.includes('Insiders') ? "vscode-insiders" : "vscode" + export const urls = { // base urls base: "https://leetcode.com", graphql: "https://leetcode.com/graphql", userGraphql: "https://leetcode.com/graphql", login: "https://leetcode.com/accounts/login/", - authLoginUrl: "https://leetcode.com/authorize-login/vscode/?path=leetcode.vscode-leetcode", + authLoginUrl: `https://leetcode.com/authorize-login/${protocol}/?path=leetcode.vscode-leetcode`, }; export const urlsCn = { @@ -140,7 +142,7 @@ export const urlsCn = { graphql: "https://leetcode.cn/graphql", userGraphql: "https://leetcode.cn/graphql/noj-go/", login: "https://leetcode.cn/accounts/login/", - authLoginUrl: "https://leetcode.cn/authorize-login/vscode/?path=leetcode.vscode-leetcode", + authLoginUrl: `https://leetcode.cn/authorize-login/${protocol}/?path=leetcode.vscode-leetcode`, }; export const getUrl = (key: string) => {