This commit is contained in:
+4
-3
@@ -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);
|
||||
|
||||
+1
-1
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user