Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix login issue on VS Code Insiders #968

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading