Skip to content

Commit

Permalink
fix: fix login issue in VS Code Insiders (#966) (#968)
Browse files Browse the repository at this point in the history
ogin issue on VS Code Insiders #968
  • Loading branch information
tomoyachen authored Jul 26, 2024
1 parent 71264fa commit b495812
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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) => {
Expand Down

0 comments on commit b495812

Please sign in to comment.