refactor: Changing OAuth 2.0 to OIDC

This commit is contained in:
OnEvent
2024-08-09 16:44:15 +08:00
parent 80568f2d87
commit a3cb66661d
6 changed files with 184 additions and 69 deletions

View File

@@ -98,12 +98,12 @@ export async function onLarkOAuthClicked(lark_client_id) {
window.open(`https://open.feishu.cn/open-apis/authen/v1/index?redirect_uri=${redirect_uri}&app_id=${lark_client_id}&state=${state}`);
}
export async function onOAuth2Clicked(auth_url, client_id, openInNewTab = false) {
export async function onOidcClicked(auth_url, client_id, openInNewTab = false) {
const state = await getOAuthState();
if (!state) return;
const redirect_uri = `${window.location.origin}/oauth/oidc`;
const response_type = "code";
const scope = "profile email";
const scope = "openid profile email";
const url = `${auth_url}?client_id=${client_id}&redirect_uri=${redirect_uri}&response_type=${response_type}&scope=${scope}&state=${state}`;
if (openInNewTab) {
window.open(url);