From 868e66e8665e5208ea3dbd61da8ebed83a2313c0 Mon Sep 17 00:00:00 2001 From: DacongDA Date: Mon, 27 May 2024 01:07:15 +0800 Subject: [PATCH] feat: fix QQ login error when using mobile browser (#2971) --- web/src/auth/Provider.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/src/auth/Provider.js b/web/src/auth/Provider.js index 35df21dd..cdc01901 100644 --- a/web/src/auth/Provider.js +++ b/web/src/auth/Provider.js @@ -399,7 +399,7 @@ export function getAuthUrl(application, provider, method, code) { scope += "+https://www.googleapis.com/auth/user.phonenumbers.read"; } - if (provider.type === "Google" || provider.type === "GitHub" || provider.type === "QQ" || provider.type === "Facebook" + if (provider.type === "Google" || provider.type === "GitHub" || provider.type === "Facebook" || provider.type === "Weibo" || provider.type === "Gitee" || provider.type === "LinkedIn" || provider.type === "GitLab" || provider.type === "AzureAD" || provider.type === "Slack" || provider.type === "Line" || provider.type === "Amazon" || provider.type === "Auth0" || provider.type === "BattleNet" || provider.type === "Bitbucket" || provider.type === "Box" || provider.type === "CloudFoundry" || provider.type === "Dailymotion" @@ -411,6 +411,8 @@ export function getAuthUrl(application, provider, method, code) { || provider.type === "Twitch" || provider.type === "Typetalk" || provider.type === "Uber" || provider.type === "VK" || provider.type === "Wepay" || provider.type === "Xero" || provider.type === "Yahoo" || provider.type === "Yammer" || provider.type === "Yandex" || provider.type === "Zoom") { return `${endpoint}?client_id=${provider.clientId}&redirect_uri=${redirectUri}&scope=${scope}&response_type=code&state=${state}`; + } else if (provider.type === "QQ") { + return `${endpoint}?response_type=code&client_id=${provider.clientId}&redirect_uri=${encodeURIComponent(redirectUri)}&state=${encodeURIComponent(state)}&scope=${encodeURIComponent(scope)}`; } else if (provider.type === "AzureADB2C") { return `https://${provider.domain}.b2clogin.com/${provider.domain}.onmicrosoft.com/${provider.appId}/oauth2/v2.0/authorize?client_id=${provider.clientId}&nonce=defaultNonce&redirect_uri=${encodeURIComponent(redirectUri)}&scope=${scope}&response_type=code&state=${state}&prompt=login`; } else if (provider.type === "DingTalk") {