From efcbb1de6146e747c4a6ee791342cfdfba9c8e08 Mon Sep 17 00:00:00 2001 From: tomoyachen Date: Thu, 25 Jul 2024 18:55:36 +0800 Subject: [PATCH] fix: fix login issue in VS Code Insiders (#966) --- src/shared.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shared.ts b/src/shared.ts index 8c6a825a..2301f7f6 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) => { pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy