From 4a0117951bb1101a35dce7c8e8705a9cd2212fce Mon Sep 17 00:00:00 2001 From: root Date: Mon, 21 Sep 2026 15:17:30 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B4=80=EB=A6=AC=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=A0=84=EC=86=A1=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EB=A9=94=EC=84=B8=EC=A7=80=20=ED=91=9C=EC=8B=9C2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.js | 7 ++++--- wrangler.toml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index 0a0b73f..d9bcbe5 100644 --- a/src/index.js +++ b/src/index.js @@ -184,7 +184,8 @@ function normalizeClaims(claims) { const custom = claims.customAttributes || claims.custom_attributes || {}; const profilePhones = Array.isArray(profile.phones) ? profile.phones : (Array.isArray(claims.phones) ? claims.phones : []); const firstProfilePhone = profilePhones[0]; - const profilePhone = profile.phone || profile.phone_number || firstProfilePhone?.phoneNumber || firstProfilePhone?.phone_number || firstProfilePhone?.number || firstProfilePhone?.value || firstProfilePhone?.phone || firstProfilePhone || ''; + const profilePhone = profile.phone || profile.phone_number || profile.phoneNumber || profile.mobile || profile.mobilePhone || firstProfilePhone?.phoneNumber || firstProfilePhone?.phone_number || firstProfilePhone?.number || firstProfilePhone?.value || firstProfilePhone?.phone || firstProfilePhone || ''; + const customPhone = custom.phone || custom.phone_number || custom.phoneNumber || custom.mobile || custom.mobilePhone || ''; const tenants = claims.tenants || claims.tenantIds || custom.tenants || []; const tenantList = Array.isArray(tenants) ? tenants : Object.keys(tenants).map((key) => ({ id: key, ...(tenants[key] || {}) })); const tenantId = claims.tenant_id || claims.tenantId || custom.tenant_id || custom.tenantId || tenantList[0]?.id || tenantList[0]?.tenantId || ''; @@ -204,7 +205,7 @@ function normalizeClaims(claims) { loginId: claims.email || claims.loginId || claims.preferred_username || profile.email || '', email: claims.email || profile.email || '', name: claims.name || profile.name || claims.display_name || '', - phone: claims.phone || claims.phone_number || profilePhone, + phone: claims.phone || claims.phone_number || claims.phoneNumber || claims.mobile || claims.mobilePhone || customPhone || profilePhone, company: custom.company || claims.company || claims.organization || profile.company || '', familyCompany: custom.familyCompany || custom.family_company || claims.familyCompany || claims.affiliation || '', department: custom.team || custom.department || claims.department || primaryTenant.name || '', @@ -235,7 +236,7 @@ async function startLogin(request, env) { authorize.searchParams.set('client_id', env.AUTH_CLIENT_ID); authorize.searchParams.set('response_type', 'code'); authorize.searchParams.set('redirect_uri', env.AUTH_REDIRECT_URI); - authorize.searchParams.set('scope', env.AUTH_SCOPE || 'openid profile email'); + authorize.searchParams.set('scope', env.AUTH_SCOPE || 'openid profile email phones'); authorize.searchParams.set('state', state); authorize.searchParams.set('nonce', nonce); authorize.searchParams.set('code_challenge', challenge); diff --git a/wrangler.toml b/wrangler.toml index 10c42db..05bbb57 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -11,7 +11,7 @@ routes = [ [vars] AUTH_REDIRECT_URI = "https://qa-test.baroncs.co.kr/auth/callback" AUTH_POST_LOGOUT_REDIRECT_URI = "https://qa-test.baroncs.co.kr/" -AUTH_SCOPE = "openid tenants profile email" +AUTH_SCOPE = "openid tenants profile email phones" AUTH_CLIENT_ID = "e1270f17-e192-4c8c-84b6-54e9698d0f36" AUTH_AUTHORIZE_URL = "https://app.brsw.kr/oidc/oauth2/auth" AUTH_TOKEN_URL = "https://app.brsw.kr/oidc/oauth2/token"