feat: add Line support as OAuth 3rd-party login (#1413)

This commit is contained in:
WangGuan
2022-12-21 02:25:58 +08:00
committed by GitHub
parent f075d0fd74
commit ae130788ec
7 changed files with 45 additions and 2 deletions

View File

@ -121,6 +121,10 @@ const authInfo = {
Bilibili: {
endpoint: "https://passport.bilibili.com/register/pc_oauth2.html",
},
Line: {
scope: "profile%20openid%20email",
endpoint: "https://access.line.me/oauth2/v2.1/authorize",
},
};
export function getProviderUrl(provider) {
@ -256,5 +260,7 @@ export function getAuthUrl(application, provider, method) {
return `${provider.customAuthUrl}?client_id=${provider.clientId}&redirect_uri=${redirectUri}&scope=${provider.customScope}&response_type=code&state=${state}`;
} else if (provider.type === "Bilibili") {
return `${endpoint}#/?client_id=${provider.clientId}&return_url=${redirectUri}&state=${state}&response_type=code`;
} else if (provider.type === "Line") {
return `${endpoint}?client_id=${provider.clientId}&redirect_uri=${redirectUri}&state=${state}&response_type=code&scope=${scope}`;
}
}