Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/large-cameras-talk.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
---
'@clerk/localizations': minor
'@clerk/clerk-js': minor
'@clerk/shared': minor
'@clerk/ui': minor
---

Allow to link external accounts to enterprise accounts via `UserProfile`
5 changes: 5 additions & 0 deletions packages/clerk-js/src/core/resources/EnterpriseAccount.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,6 +61,8 @@ export class EnterpriseAccount extends BaseResource implements EnterpriseAccount
return this;
}

destroy = (): Promise<void> => this._baseDelete();

public __internal_toSnapshot(): EnterpriseAccountJSONSnapshot {
return {
object: 'enterprise_account',
Expand DownExpand Up@@ -93,6 +95,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
protocol!: EnterpriseAccountResource['protocol'];
provider!: EnterpriseAccountResource['provider'];
syncUserAttributes!: boolean;
allowOrganizationAccountLinking!: boolean;
createdAt!: Date;
updatedAt!: Date;
enterpriseConnectionId: string | null = '';
Expand All@@ -114,6 +117,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
this.allowSubdomains = data.allow_subdomains;
this.allowIdpInitiated = data.allow_idp_initiated;
this.disableAdditionalIdentifications = data.disable_additional_identifications;
this.allowOrganizationAccountLinking = data.allow_organization_account_linking;
this.createdAt = unixEpochToDate(data.created_at);
this.updatedAt = unixEpochToDate(data.updated_at);
this.enterpriseConnectionId = data.enterprise_connection_id;
Expand All@@ -136,6 +140,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
allow_subdomains: this.allowSubdomains,
allow_idp_initiated: this.allowIdpInitiated,
disable_additional_identifications: this.disableAdditionalIdentifications,
allow_organization_account_linking: this.allowOrganizationAccountLinking,
enterprise_connection_id: this.enterpriseConnectionId,
created_at: this.createdAt.getTime(),
updated_at: this.updatedAt.getTime(),
Expand Down
29 changes: 28 additions & 1 deletion packages/clerk-js/src/core/resources/User.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,9 +9,12 @@ import type {
DeletedObjectJSON,
DeletedObjectResource,
EmailAddressResource,
EnterpriseAccountConnectionJSON,
EnterpriseAccountConnectionResource,
EnterpriseAccountResource,
ExternalAccountJSON,
ExternalAccountResource,
GetEnterpriseConnectionsParams,
GetOrganizationMemberships,
GetUserOrganizationInvitationsParams,
GetUserOrganizationSuggestionsParams,
Expand DownExpand Up@@ -42,6 +45,7 @@ import {
DeletedObject,
EmailAddress,
EnterpriseAccount,
EnterpriseAccountConnection,
ExternalAccount,
Image,
OrganizationMembership,
Expand DownExpand Up@@ -156,7 +160,7 @@ export class User extends BaseResource implements UserResource {
};

createExternalAccount = async (params: CreateExternalAccountParams): Promise<ExternalAccountResource> => {
const { strategy, redirectUrl, additionalScopes } = params || {};
const { strategy, redirectUrl, additionalScopes, enterpriseConnectionId } = params || {};

const json = (
await BaseResource._fetch<ExternalAccountJSON>({
Expand All@@ -166,6 +170,7 @@ export class User extends BaseResource implements UserResource {
strategy,
redirect_url: redirectUrl,
additional_scope: additionalScopes,
enterprise_connection_id: enterpriseConnectionId,
} as any,
})
)?.response as unknown as ExternalAccountJSON;
Expand DownExpand Up@@ -289,6 +294,28 @@ export class User extends BaseResource implements UserResource {
return new DeletedObject(json);
};

getEnterpriseConnections = async (
params?: GetEnterpriseConnectionsParams,
): Promise<EnterpriseAccountConnectionResource[]> => {
const { withOrganizationAccountLinking } = params || {};

const json = (
await BaseResource._fetch({
path: '/me/enterprise_connections',
method: 'GET',
...(withOrganizationAccountLinking !== undefined
? {
search: {
with_organization_account_linking: String(withOrganizationAccountLinking),
},
}
: {}),
})
)?.response as unknown as EnterpriseAccountConnectionJSON[];

return (json || []).map(connection => new EnterpriseAccountConnection(connection));
};

initializePaymentMethod: typeof initializePaymentMethod = params => {
return initializePaymentMethod(params);
};
Expand Down
82 changes: 82 additions & 0 deletions packages/clerk-js/src/core/resources/__tests__/User.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,88 @@ describe('User', () => {
});
});

it('creates an external account with enterprise connection id', async () => {
const externalAccountJSON = {
object: 'external_account',
provider: 'saml_okta',
verification: {
external_verification_redirect_url: 'https://www.example.com',
},
};

// @ts-ignore
BaseResource._fetch = vi.fn().mockReturnValue(Promise.resolve({ response: externalAccountJSON }));

const user = new User({
email_addresses: [],
phone_numbers: [],
web3_wallets: [],
external_accounts: [],
} as unknown as UserJSON);

await user.createExternalAccount({
enterpriseConnectionId: 'ec_123',
redirectUrl: 'https://www.example.com',
});

// @ts-ignore
expect(BaseResource._fetch).toHaveBeenCalledWith({
method: 'POST',
path: '/me/external_accounts',
body: {
strategy: undefined,
redirect_url: 'https://www.example.com',
additional_scope: undefined,
enterprise_connection_id: 'ec_123',
},
});
});

it('fetches enterprise connections', async () => {
const enterpriseConnectionsJSON = [
{
id: 'ec_123',
object: 'enterprise_account_connection',
name: 'Acme Corp SSO',
active: true,
allow_organization_account_linking: true,
domain: 'acme.com',
protocol: 'saml',
provider: 'saml_okta',
logo_public_url: null,
sync_user_attributes: true,
allow_subdomains: false,
allow_idp_initiated: false,
disable_additional_identifications: false,
enterprise_connection_id: 'ec_123',
created_at: 1234567890,
updated_at: 1234567890,
},
];

// @ts-ignore
BaseResource._fetch = vi.fn().mockReturnValue(Promise.resolve({ response: enterpriseConnectionsJSON }));

const user = new User({
email_addresses: [],
phone_numbers: [],
web3_wallets: [],
external_accounts: [],
} as unknown as UserJSON);

const connections = await user.getEnterpriseConnections();

// @ts-ignore
expect(BaseResource._fetch).toHaveBeenCalledWith({
method: 'GET',
path: '/me/enterprise_connections',
});

expect(connections).toHaveLength(1);
expect(connections[0].name).toBe('Acme Corp SSO');
expect(connections[0].allowOrganizationAccountLinking).toBe(true);
});

it('creates a web3 wallet', async () => {
const targetWeb3Wallet = '0x0000000000000000000000000000000000000000';
const web3WalletJSON = {
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ar-SA.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1338,6 +1338,7 @@ export const arSA: LocalizationResource = {
title: 'العنوان الإلكتروني',
},
enterpriseAccountsSection: {
primaryButton: 'ربط حساب',
title: 'حساب المؤسسات',
},
headerTitle__account: 'الحساب',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/be-BY.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1357,6 +1357,7 @@ export const beBY: LocalizationResource = {
title: 'Адрасы электроннай пошты',
},
enterpriseAccountsSection: {
primaryButton: 'Падключыць уліковы запіс',
title: 'Enterprise accounts',
},
headerTitle__account: 'Уліковы запіс',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/bg-BG.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1348,6 +1348,7 @@ export const bgBG: LocalizationResource = {
title: 'Имейл адреси',
},
enterpriseAccountsSection: {
primaryButton: 'Свържи акаунт',
title: 'Корпоративни акаунти',
},
headerTitle__account: 'Профил',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/bn-IN.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1359,6 +1359,7 @@ export const bnIN: LocalizationResource = {
title: 'ইমেইল ঠিকানা',
},
enterpriseAccountsSection: {
primaryButton: 'অ্যাকাউন্ট সংযুক্ত করুন',
title: 'এন্টারপ্রাইজ অ্যাকাউন্ট',
},
headerTitle__account: 'প্রোফাইল বিবরণ',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ca-ES.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1354,6 +1354,7 @@ export const caES: LocalizationResource = {
title: 'Adreces de correu electrònic',
},
enterpriseAccountsSection: {
primaryButton: 'Connecta compte',
title: "Comptes d'empresa",
},
headerTitle__account: 'Detalls del perfil',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/cs-CZ.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1361,6 +1361,7 @@ export const csCZ: LocalizationResource = {
title: 'E-mailové adresy',
},
enterpriseAccountsSection: {
primaryButton: 'Připojit účet',
title: 'Podnikové účty',
},
headerTitle__account: 'Podrobnosti profilu',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/da-DK.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1345,6 +1345,7 @@ export const daDK: LocalizationResource = {
title: 'E-mailadresser',
},
enterpriseAccountsSection: {
primaryButton: 'Tilknyt konto',
title: 'Virksomhedskonti',
},
headerTitle__account: 'Konto',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/de-DE.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1383,6 +1383,7 @@ export const deDE: LocalizationResource = {
title: 'E-Mail-Adressen',
},
enterpriseAccountsSection: {
primaryButton: 'Konto verbinden',
title: 'Unternehmens-Konten',
},
headerTitle__account: 'Konto',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/el-GR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1374,6 +1374,7 @@ export const elGR: LocalizationResource = {
title: 'Διευθύνσεις email',
},
enterpriseAccountsSection: {
primaryButton: 'Σύνδεση λογαριασμού',
title: 'Επιχειρησιακοί λογαριασμοί',
},
headerTitle__account: 'Λογαριασμός',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/en-GB.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1352,6 +1352,7 @@ export const enGB: LocalizationResource = {
title: 'Email addresses',
},
enterpriseAccountsSection: {
primaryButton: 'Connect account',
title: 'Enterprise accounts',
},
headerTitle__account: 'Profile details',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/en-US.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1360,6 +1360,7 @@ export const enUS: LocalizationResource = {
title: 'Email addresses',
},
enterpriseAccountsSection: {
primaryButton: 'Connect account',
title: 'Enterprise accounts',
},
headerTitle__account: 'Profile details',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-CR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1362,6 +1362,7 @@ export const esCR: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas de empresa',
},
headerTitle__account: 'Detalles de la cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-ES.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const esES: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas empresariales',
},
headerTitle__account: 'Cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-MX.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const esMX: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas de empresa',
},
headerTitle__account: 'Detalles de la cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-UY.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1362,6 +1362,7 @@ export const esUY: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas empresariales',
},
headerTitle__account: 'Detalles del perfil',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fa-IR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1357,6 +1357,7 @@ export const faIR: LocalizationResource = {
title: 'آدرس های ایمیل',
},
enterpriseAccountsSection: {
primaryButton: 'اتصال حساب',
title: 'حساب های سازمانی',
},
headerTitle__account: 'جزئیات نمایه',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fi-FI.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const fiFI: LocalizationResource = {
title: 'Sähköpostiosoitteet',
},
enterpriseAccountsSection: {
primaryButton: 'Yhdistä tili',
title: 'Yritystilit',
},
headerTitle__account: 'Tili',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fr-FR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1372,6 +1372,7 @@ export const frFR: LocalizationResource = {
title: 'Adresses e-mail',
},
enterpriseAccountsSection: {
primaryButton: 'Connecter un compte',
title: 'Comptes entreprises',
},
headerTitle__account: 'Compte',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/he-IL.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1325,6 +1325,7 @@ export const heIL: LocalizationResource = {
title: 'כתובת אימייל',
},
enterpriseAccountsSection: {
primaryButton: 'חבר חשבון',
title: 'חשבונות ארגוניים',
},
headerTitle__account: 'חשבון',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hi-IN.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1360,6 +1360,7 @@ export const hiIN: LocalizationResource = {
title: 'ईमेल पते',
},
enterpriseAccountsSection: {
primaryButton: 'खाता कनेक्ट करें',
title: 'एंटरप्राइज खाते',
},
headerTitle__account: 'प्रोफ़ाइल विवरण',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hr-HR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1353,6 +1353,7 @@ export const hrHR: LocalizationResource = {
title: 'Adrese e-pošte',
},
enterpriseAccountsSection: {
primaryButton: 'Poveži račun',
title: 'Poslovni računi',
},
headerTitle__account: 'Detalji profila',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hu-HU.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1350,6 +1350,7 @@ export const huHU: LocalizationResource = {
title: 'Email címek',
},
enterpriseAccountsSection: {
primaryButton: 'Fiók összekötése',
title: 'Vállalati fiókok',
},
headerTitle__account: 'Profil adatok',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/id-ID.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1348,6 +1348,7 @@ export const idID: LocalizationResource = {
title: undefined,
},
enterpriseAccountsSection: {
primaryButton: 'Hubungkan akun',
title: undefined,
},
headerTitle__account: undefined,
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/is-IS.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1353,6 +1353,7 @@ export const isIS: LocalizationResource = {
title: 'Netföng',
},
enterpriseAccountsSection: {
primaryButton: 'Tengja reikning',
title: 'Fyrirtækjareikningar',
},
headerTitle__account: 'Prófílupplýsingar',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/it-IT.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1359,6 +1359,7 @@ export const itIT: LocalizationResource = {
title: 'Indirizzi email',
},
enterpriseAccountsSection: {
primaryButton: 'Collega account',
title: 'Account aziendali',
},
headerTitle__account: 'Dettagli profilo',
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/large-cameras-talk.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
---
'@clerk/localizations': minor
'@clerk/clerk-js': minor
'@clerk/shared': minor
'@clerk/ui': minor
---

Allow to link external accounts to enterprise accounts via `UserProfile`
5 changes: 5 additions & 0 deletions packages/clerk-js/src/core/resources/EnterpriseAccount.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,6 +61,8 @@ export class EnterpriseAccount extends BaseResource implements EnterpriseAccount
return this;
}

destroy = (): Promise<void> => this._baseDelete();

public __internal_toSnapshot(): EnterpriseAccountJSONSnapshot {
return {
object: 'enterprise_account',
Expand DownExpand Up@@ -93,6 +95,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
protocol!: EnterpriseAccountResource['protocol'];
provider!: EnterpriseAccountResource['provider'];
syncUserAttributes!: boolean;
allowOrganizationAccountLinking!: boolean;
createdAt!: Date;
updatedAt!: Date;
enterpriseConnectionId: string | null = '';
Expand All@@ -114,6 +117,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
this.allowSubdomains = data.allow_subdomains;
this.allowIdpInitiated = data.allow_idp_initiated;
this.disableAdditionalIdentifications = data.disable_additional_identifications;
this.allowOrganizationAccountLinking = data.allow_organization_account_linking;
this.createdAt = unixEpochToDate(data.created_at);
this.updatedAt = unixEpochToDate(data.updated_at);
this.enterpriseConnectionId = data.enterprise_connection_id;
Expand All@@ -136,6 +140,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
allow_subdomains: this.allowSubdomains,
allow_idp_initiated: this.allowIdpInitiated,
disable_additional_identifications: this.disableAdditionalIdentifications,
allow_organization_account_linking: this.allowOrganizationAccountLinking,
enterprise_connection_id: this.enterpriseConnectionId,
created_at: this.createdAt.getTime(),
updated_at: this.updatedAt.getTime(),
Expand Down
29 changes: 28 additions & 1 deletion packages/clerk-js/src/core/resources/User.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,9 +9,12 @@ import type {
DeletedObjectJSON,
DeletedObjectResource,
EmailAddressResource,
EnterpriseAccountConnectionJSON,
EnterpriseAccountConnectionResource,
EnterpriseAccountResource,
ExternalAccountJSON,
ExternalAccountResource,
GetEnterpriseConnectionsParams,
GetOrganizationMemberships,
GetUserOrganizationInvitationsParams,
GetUserOrganizationSuggestionsParams,
Expand DownExpand Up@@ -42,6 +45,7 @@ import {
DeletedObject,
EmailAddress,
EnterpriseAccount,
EnterpriseAccountConnection,
ExternalAccount,
Image,
OrganizationMembership,
Expand DownExpand Up@@ -156,7 +160,7 @@ export class User extends BaseResource implements UserResource {
};

createExternalAccount = async (params: CreateExternalAccountParams): Promise<ExternalAccountResource> => {
const { strategy, redirectUrl, additionalScopes } = params || {};
const { strategy, redirectUrl, additionalScopes, enterpriseConnectionId } = params || {};

const json = (
await BaseResource._fetch<ExternalAccountJSON>({
Expand All@@ -166,6 +170,7 @@ export class User extends BaseResource implements UserResource {
strategy,
redirect_url: redirectUrl,
additional_scope: additionalScopes,
enterprise_connection_id: enterpriseConnectionId,
} as any,
})
)?.response as unknown as ExternalAccountJSON;
Expand DownExpand Up@@ -289,6 +294,28 @@ export class User extends BaseResource implements UserResource {
return new DeletedObject(json);
};

getEnterpriseConnections = async (
params?: GetEnterpriseConnectionsParams,
): Promise<EnterpriseAccountConnectionResource[]> => {
const { withOrganizationAccountLinking } = params || {};

const json = (
await BaseResource._fetch({
path: '/me/enterprise_connections',
method: 'GET',
...(withOrganizationAccountLinking !== undefined
? {
search: {
with_organization_account_linking: String(withOrganizationAccountLinking),
},
}
: {}),
})
)?.response as unknown as EnterpriseAccountConnectionJSON[];

return (json || []).map(connection => new EnterpriseAccountConnection(connection));
};

initializePaymentMethod: typeof initializePaymentMethod = params => {
return initializePaymentMethod(params);
};
Expand Down
82 changes: 82 additions & 0 deletions packages/clerk-js/src/core/resources/__tests__/User.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,88 @@ describe('User', () => {
});
});

it('creates an external account with enterprise connection id', async () => {
const externalAccountJSON = {
object: 'external_account',
provider: 'saml_okta',
verification: {
external_verification_redirect_url: 'https://www.example.com',
},
};

// @ts-ignore
BaseResource._fetch = vi.fn().mockReturnValue(Promise.resolve({ response: externalAccountJSON }));

const user = new User({
email_addresses: [],
phone_numbers: [],
web3_wallets: [],
external_accounts: [],
} as unknown as UserJSON);

await user.createExternalAccount({
enterpriseConnectionId: 'ec_123',
redirectUrl: 'https://www.example.com',
});

// @ts-ignore
expect(BaseResource._fetch).toHaveBeenCalledWith({
method: 'POST',
path: '/me/external_accounts',
body: {
strategy: undefined,
redirect_url: 'https://www.example.com',
additional_scope: undefined,
enterprise_connection_id: 'ec_123',
},
});
});

it('fetches enterprise connections', async () => {
const enterpriseConnectionsJSON = [
{
id: 'ec_123',
object: 'enterprise_account_connection',
name: 'Acme Corp SSO',
active: true,
allow_organization_account_linking: true,
domain: 'acme.com',
protocol: 'saml',
provider: 'saml_okta',
logo_public_url: null,
sync_user_attributes: true,
allow_subdomains: false,
allow_idp_initiated: false,
disable_additional_identifications: false,
enterprise_connection_id: 'ec_123',
created_at: 1234567890,
updated_at: 1234567890,
},
];

// @ts-ignore
BaseResource._fetch = vi.fn().mockReturnValue(Promise.resolve({ response: enterpriseConnectionsJSON }));

const user = new User({
email_addresses: [],
phone_numbers: [],
web3_wallets: [],
external_accounts: [],
} as unknown as UserJSON);

const connections = await user.getEnterpriseConnections();

// @ts-ignore
expect(BaseResource._fetch).toHaveBeenCalledWith({
method: 'GET',
path: '/me/enterprise_connections',
});

expect(connections).toHaveLength(1);
expect(connections[0].name).toBe('Acme Corp SSO');
expect(connections[0].allowOrganizationAccountLinking).toBe(true);
});

it('creates a web3 wallet', async () => {
const targetWeb3Wallet = '0x0000000000000000000000000000000000000000';
const web3WalletJSON = {
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ar-SA.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1338,6 +1338,7 @@ export const arSA: LocalizationResource = {
title: 'العنوان الإلكتروني',
},
enterpriseAccountsSection: {
primaryButton: 'ربط حساب',
title: 'حساب المؤسسات',
},
headerTitle__account: 'الحساب',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/be-BY.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1357,6 +1357,7 @@ export const beBY: LocalizationResource = {
title: 'Адрасы электроннай пошты',
},
enterpriseAccountsSection: {
primaryButton: 'Падключыць уліковы запіс',
title: 'Enterprise accounts',
},
headerTitle__account: 'Уліковы запіс',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/bg-BG.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1348,6 +1348,7 @@ export const bgBG: LocalizationResource = {
title: 'Имейл адреси',
},
enterpriseAccountsSection: {
primaryButton: 'Свържи акаунт',
title: 'Корпоративни акаунти',
},
headerTitle__account: 'Профил',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/bn-IN.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1359,6 +1359,7 @@ export const bnIN: LocalizationResource = {
title: 'ইমেইল ঠিকানা',
},
enterpriseAccountsSection: {
primaryButton: 'অ্যাকাউন্ট সংযুক্ত করুন',
title: 'এন্টারপ্রাইজ অ্যাকাউন্ট',
},
headerTitle__account: 'প্রোফাইল বিবরণ',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ca-ES.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1354,6 +1354,7 @@ export const caES: LocalizationResource = {
title: 'Adreces de correu electrònic',
},
enterpriseAccountsSection: {
primaryButton: 'Connecta compte',
title: "Comptes d'empresa",
},
headerTitle__account: 'Detalls del perfil',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/cs-CZ.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1361,6 +1361,7 @@ export const csCZ: LocalizationResource = {
title: 'E-mailové adresy',
},
enterpriseAccountsSection: {
primaryButton: 'Připojit účet',
title: 'Podnikové účty',
},
headerTitle__account: 'Podrobnosti profilu',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/da-DK.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1345,6 +1345,7 @@ export const daDK: LocalizationResource = {
title: 'E-mailadresser',
},
enterpriseAccountsSection: {
primaryButton: 'Tilknyt konto',
title: 'Virksomhedskonti',
},
headerTitle__account: 'Konto',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/de-DE.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1383,6 +1383,7 @@ export const deDE: LocalizationResource = {
title: 'E-Mail-Adressen',
},
enterpriseAccountsSection: {
primaryButton: 'Konto verbinden',
title: 'Unternehmens-Konten',
},
headerTitle__account: 'Konto',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/el-GR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1374,6 +1374,7 @@ export const elGR: LocalizationResource = {
title: 'Διευθύνσεις email',
},
enterpriseAccountsSection: {
primaryButton: 'Σύνδεση λογαριασμού',
title: 'Επιχειρησιακοί λογαριασμοί',
},
headerTitle__account: 'Λογαριασμός',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/en-GB.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1352,6 +1352,7 @@ export const enGB: LocalizationResource = {
title: 'Email addresses',
},
enterpriseAccountsSection: {
primaryButton: 'Connect account',
title: 'Enterprise accounts',
},
headerTitle__account: 'Profile details',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/en-US.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1360,6 +1360,7 @@ export const enUS: LocalizationResource = {
title: 'Email addresses',
},
enterpriseAccountsSection: {
primaryButton: 'Connect account',
title: 'Enterprise accounts',
},
headerTitle__account: 'Profile details',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-CR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1362,6 +1362,7 @@ export const esCR: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas de empresa',
},
headerTitle__account: 'Detalles de la cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-ES.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const esES: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas empresariales',
},
headerTitle__account: 'Cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-MX.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const esMX: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas de empresa',
},
headerTitle__account: 'Detalles de la cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-UY.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1362,6 +1362,7 @@ export const esUY: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas empresariales',
},
headerTitle__account: 'Detalles del perfil',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fa-IR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1357,6 +1357,7 @@ export const faIR: LocalizationResource = {
title: 'آدرس های ایمیل',
},
enterpriseAccountsSection: {
primaryButton: 'اتصال حساب',
title: 'حساب های سازمانی',
},
headerTitle__account: 'جزئیات نمایه',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fi-FI.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const fiFI: LocalizationResource = {
title: 'Sähköpostiosoitteet',
},
enterpriseAccountsSection: {
primaryButton: 'Yhdistä tili',
title: 'Yritystilit',
},
headerTitle__account: 'Tili',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fr-FR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1372,6 +1372,7 @@ export const frFR: LocalizationResource = {
title: 'Adresses e-mail',
},
enterpriseAccountsSection: {
primaryButton: 'Connecter un compte',
title: 'Comptes entreprises',
},
headerTitle__account: 'Compte',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/he-IL.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1325,6 +1325,7 @@ export const heIL: LocalizationResource = {
title: 'כתובת אימייל',
},
enterpriseAccountsSection: {
primaryButton: 'חבר חשבון',
title: 'חשבונות ארגוניים',
},
headerTitle__account: 'חשבון',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hi-IN.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1360,6 +1360,7 @@ export const hiIN: LocalizationResource = {
title: 'ईमेल पते',
},
enterpriseAccountsSection: {
primaryButton: 'खाता कनेक्ट करें',
title: 'एंटरप्राइज खाते',
},
headerTitle__account: 'प्रोफ़ाइल विवरण',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hr-HR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1353,6 +1353,7 @@ export const hrHR: LocalizationResource = {
title: 'Adrese e-pošte',
},
enterpriseAccountsSection: {
primaryButton: 'Poveži račun',
title: 'Poslovni računi',
},
headerTitle__account: 'Detalji profila',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hu-HU.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1350,6 +1350,7 @@ export const huHU: LocalizationResource = {
title: 'Email címek',
},
enterpriseAccountsSection: {
primaryButton: 'Fiók összekötése',
title: 'Vállalati fiókok',
},
headerTitle__account: 'Profil adatok',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/id-ID.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1348,6 +1348,7 @@ export const idID: LocalizationResource = {
title: undefined,
},
enterpriseAccountsSection: {
primaryButton: 'Hubungkan akun',
title: undefined,
},
headerTitle__account: undefined,
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/is-IS.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1353,6 +1353,7 @@ export const isIS: LocalizationResource = {
title: 'Netföng',
},
enterpriseAccountsSection: {
primaryButton: 'Tengja reikning',
title: 'Fyrirtækjareikningar',
},
headerTitle__account: 'Prófílupplýsingar',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/it-IT.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1359,6 +1359,7 @@ export const itIT: LocalizationResource = {
title: 'Indirizzi email',
},
enterpriseAccountsSection: {
primaryButton: 'Collega account',
title: 'Account aziendali',
},
headerTitle__account: 'Dettagli profilo',
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/large-cameras-talk.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
---
'@clerk/localizations': minor
'@clerk/clerk-js': minor
'@clerk/shared': minor
'@clerk/ui': minor
---

Allow to link external accounts to enterprise accounts via `UserProfile`
5 changes: 5 additions & 0 deletions packages/clerk-js/src/core/resources/EnterpriseAccount.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,6 +61,8 @@ export class EnterpriseAccount extends BaseResource implements EnterpriseAccount
return this;
}

destroy = (): Promise<void> => this._baseDelete();

public __internal_toSnapshot(): EnterpriseAccountJSONSnapshot {
return {
object: 'enterprise_account',
Expand DownExpand Up@@ -93,6 +95,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
protocol!: EnterpriseAccountResource['protocol'];
provider!: EnterpriseAccountResource['provider'];
syncUserAttributes!: boolean;
allowOrganizationAccountLinking!: boolean;
createdAt!: Date;
updatedAt!: Date;
enterpriseConnectionId: string | null = '';
Expand All@@ -114,6 +117,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
this.allowSubdomains = data.allow_subdomains;
this.allowIdpInitiated = data.allow_idp_initiated;
this.disableAdditionalIdentifications = data.disable_additional_identifications;
this.allowOrganizationAccountLinking = data.allow_organization_account_linking;
this.createdAt = unixEpochToDate(data.created_at);
this.updatedAt = unixEpochToDate(data.updated_at);
this.enterpriseConnectionId = data.enterprise_connection_id;
Expand All@@ -136,6 +140,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
allow_subdomains: this.allowSubdomains,
allow_idp_initiated: this.allowIdpInitiated,
disable_additional_identifications: this.disableAdditionalIdentifications,
allow_organization_account_linking: this.allowOrganizationAccountLinking,
enterprise_connection_id: this.enterpriseConnectionId,
created_at: this.createdAt.getTime(),
updated_at: this.updatedAt.getTime(),
Expand Down
29 changes: 28 additions & 1 deletion packages/clerk-js/src/core/resources/User.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,9 +9,12 @@ import type {
DeletedObjectJSON,
DeletedObjectResource,
EmailAddressResource,
EnterpriseAccountConnectionJSON,
EnterpriseAccountConnectionResource,
EnterpriseAccountResource,
ExternalAccountJSON,
ExternalAccountResource,
GetEnterpriseConnectionsParams,
GetOrganizationMemberships,
GetUserOrganizationInvitationsParams,
GetUserOrganizationSuggestionsParams,
Expand DownExpand Up@@ -42,6 +45,7 @@ import {
DeletedObject,
EmailAddress,
EnterpriseAccount,
EnterpriseAccountConnection,
ExternalAccount,
Image,
OrganizationMembership,
Expand DownExpand Up@@ -156,7 +160,7 @@ export class User extends BaseResource implements UserResource {
};

createExternalAccount = async (params: CreateExternalAccountParams): Promise<ExternalAccountResource> => {
const { strategy, redirectUrl, additionalScopes } = params || {};
const { strategy, redirectUrl, additionalScopes, enterpriseConnectionId } = params || {};

const json = (
await BaseResource._fetch<ExternalAccountJSON>({
Expand All@@ -166,6 +170,7 @@ export class User extends BaseResource implements UserResource {
strategy,
redirect_url: redirectUrl,
additional_scope: additionalScopes,
enterprise_connection_id: enterpriseConnectionId,
} as any,
})
)?.response as unknown as ExternalAccountJSON;
Expand DownExpand Up@@ -289,6 +294,28 @@ export class User extends BaseResource implements UserResource {
return new DeletedObject(json);
};

getEnterpriseConnections = async (
params?: GetEnterpriseConnectionsParams,
): Promise<EnterpriseAccountConnectionResource[]> => {
const { withOrganizationAccountLinking } = params || {};

const json = (
await BaseResource._fetch({
path: '/me/enterprise_connections',
method: 'GET',
...(withOrganizationAccountLinking !== undefined
? {
search: {
with_organization_account_linking: String(withOrganizationAccountLinking),
},
}
: {}),
})
)?.response as unknown as EnterpriseAccountConnectionJSON[];

return (json || []).map(connection => new EnterpriseAccountConnection(connection));
};

initializePaymentMethod: typeof initializePaymentMethod = params => {
return initializePaymentMethod(params);
};
Expand Down
82 changes: 82 additions & 0 deletions packages/clerk-js/src/core/resources/__tests__/User.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,88 @@ describe('User', () => {
});
});

it('creates an external account with enterprise connection id', async () => {
const externalAccountJSON = {
object: 'external_account',
provider: 'saml_okta',
verification: {
external_verification_redirect_url: 'https://www.example.com',
},
};

// @ts-ignore
BaseResource._fetch = vi.fn().mockReturnValue(Promise.resolve({ response: externalAccountJSON }));

const user = new User({
email_addresses: [],
phone_numbers: [],
web3_wallets: [],
external_accounts: [],
} as unknown as UserJSON);

await user.createExternalAccount({
enterpriseConnectionId: 'ec_123',
redirectUrl: 'https://www.example.com',
});

// @ts-ignore
expect(BaseResource._fetch).toHaveBeenCalledWith({
method: 'POST',
path: '/me/external_accounts',
body: {
strategy: undefined,
redirect_url: 'https://www.example.com',
additional_scope: undefined,
enterprise_connection_id: 'ec_123',
},
});
});

it('fetches enterprise connections', async () => {
const enterpriseConnectionsJSON = [
{
id: 'ec_123',
object: 'enterprise_account_connection',
name: 'Acme Corp SSO',
active: true,
allow_organization_account_linking: true,
domain: 'acme.com',
protocol: 'saml',
provider: 'saml_okta',
logo_public_url: null,
sync_user_attributes: true,
allow_subdomains: false,
allow_idp_initiated: false,
disable_additional_identifications: false,
enterprise_connection_id: 'ec_123',
created_at: 1234567890,
updated_at: 1234567890,
},
];

// @ts-ignore
BaseResource._fetch = vi.fn().mockReturnValue(Promise.resolve({ response: enterpriseConnectionsJSON }));

const user = new User({
email_addresses: [],
phone_numbers: [],
web3_wallets: [],
external_accounts: [],
} as unknown as UserJSON);

const connections = await user.getEnterpriseConnections();

// @ts-ignore
expect(BaseResource._fetch).toHaveBeenCalledWith({
method: 'GET',
path: '/me/enterprise_connections',
});

expect(connections).toHaveLength(1);
expect(connections[0].name).toBe('Acme Corp SSO');
expect(connections[0].allowOrganizationAccountLinking).toBe(true);
});

it('creates a web3 wallet', async () => {
const targetWeb3Wallet = '0x0000000000000000000000000000000000000000';
const web3WalletJSON = {
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ar-SA.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1338,6 +1338,7 @@ export const arSA: LocalizationResource = {
title: 'العنوان الإلكتروني',
},
enterpriseAccountsSection: {
primaryButton: 'ربط حساب',
title: 'حساب المؤسسات',
},
headerTitle__account: 'الحساب',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/be-BY.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1357,6 +1357,7 @@ export const beBY: LocalizationResource = {
title: 'Адрасы электроннай пошты',
},
enterpriseAccountsSection: {
primaryButton: 'Падключыць уліковы запіс',
title: 'Enterprise accounts',
},
headerTitle__account: 'Уліковы запіс',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/bg-BG.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1348,6 +1348,7 @@ export const bgBG: LocalizationResource = {
title: 'Имейл адреси',
},
enterpriseAccountsSection: {
primaryButton: 'Свържи акаунт',
title: 'Корпоративни акаунти',
},
headerTitle__account: 'Профил',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/bn-IN.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1359,6 +1359,7 @@ export const bnIN: LocalizationResource = {
title: 'ইমেইল ঠিকানা',
},
enterpriseAccountsSection: {
primaryButton: 'অ্যাকাউন্ট সংযুক্ত করুন',
title: 'এন্টারপ্রাইজ অ্যাকাউন্ট',
},
headerTitle__account: 'প্রোফাইল বিবরণ',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ca-ES.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1354,6 +1354,7 @@ export const caES: LocalizationResource = {
title: 'Adreces de correu electrònic',
},
enterpriseAccountsSection: {
primaryButton: 'Connecta compte',
title: "Comptes d'empresa",
},
headerTitle__account: 'Detalls del perfil',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/cs-CZ.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1361,6 +1361,7 @@ export const csCZ: LocalizationResource = {
title: 'E-mailové adresy',
},
enterpriseAccountsSection: {
primaryButton: 'Připojit účet',
title: 'Podnikové účty',
},
headerTitle__account: 'Podrobnosti profilu',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/da-DK.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1345,6 +1345,7 @@ export const daDK: LocalizationResource = {
title: 'E-mailadresser',
},
enterpriseAccountsSection: {
primaryButton: 'Tilknyt konto',
title: 'Virksomhedskonti',
},
headerTitle__account: 'Konto',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/de-DE.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1383,6 +1383,7 @@ export const deDE: LocalizationResource = {
title: 'E-Mail-Adressen',
},
enterpriseAccountsSection: {
primaryButton: 'Konto verbinden',
title: 'Unternehmens-Konten',
},
headerTitle__account: 'Konto',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/el-GR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1374,6 +1374,7 @@ export const elGR: LocalizationResource = {
title: 'Διευθύνσεις email',
},
enterpriseAccountsSection: {
primaryButton: 'Σύνδεση λογαριασμού',
title: 'Επιχειρησιακοί λογαριασμοί',
},
headerTitle__account: 'Λογαριασμός',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/en-GB.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1352,6 +1352,7 @@ export const enGB: LocalizationResource = {
title: 'Email addresses',
},
enterpriseAccountsSection: {
primaryButton: 'Connect account',
title: 'Enterprise accounts',
},
headerTitle__account: 'Profile details',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/en-US.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1360,6 +1360,7 @@ export const enUS: LocalizationResource = {
title: 'Email addresses',
},
enterpriseAccountsSection: {
primaryButton: 'Connect account',
title: 'Enterprise accounts',
},
headerTitle__account: 'Profile details',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-CR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1362,6 +1362,7 @@ export const esCR: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas de empresa',
},
headerTitle__account: 'Detalles de la cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-ES.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const esES: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas empresariales',
},
headerTitle__account: 'Cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-MX.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const esMX: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas de empresa',
},
headerTitle__account: 'Detalles de la cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-UY.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1362,6 +1362,7 @@ export const esUY: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas empresariales',
},
headerTitle__account: 'Detalles del perfil',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fa-IR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1357,6 +1357,7 @@ export const faIR: LocalizationResource = {
title: 'آدرس های ایمیل',
},
enterpriseAccountsSection: {
primaryButton: 'اتصال حساب',
title: 'حساب های سازمانی',
},
headerTitle__account: 'جزئیات نمایه',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fi-FI.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const fiFI: LocalizationResource = {
title: 'Sähköpostiosoitteet',
},
enterpriseAccountsSection: {
primaryButton: 'Yhdistä tili',
title: 'Yritystilit',
},
headerTitle__account: 'Tili',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fr-FR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1372,6 +1372,7 @@ export const frFR: LocalizationResource = {
title: 'Adresses e-mail',
},
enterpriseAccountsSection: {
primaryButton: 'Connecter un compte',
title: 'Comptes entreprises',
},
headerTitle__account: 'Compte',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/he-IL.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1325,6 +1325,7 @@ export const heIL: LocalizationResource = {
title: 'כתובת אימייל',
},
enterpriseAccountsSection: {
primaryButton: 'חבר חשבון',
title: 'חשבונות ארגוניים',
},
headerTitle__account: 'חשבון',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hi-IN.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1360,6 +1360,7 @@ export const hiIN: LocalizationResource = {
title: 'ईमेल पते',
},
enterpriseAccountsSection: {
primaryButton: 'खाता कनेक्ट करें',
title: 'एंटरप्राइज खाते',
},
headerTitle__account: 'प्रोफ़ाइल विवरण',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hr-HR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1353,6 +1353,7 @@ export const hrHR: LocalizationResource = {
title: 'Adrese e-pošte',
},
enterpriseAccountsSection: {
primaryButton: 'Poveži račun',
title: 'Poslovni računi',
},
headerTitle__account: 'Detalji profila',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hu-HU.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1350,6 +1350,7 @@ export const huHU: LocalizationResource = {
title: 'Email címek',
},
enterpriseAccountsSection: {
primaryButton: 'Fiók összekötése',
title: 'Vállalati fiókok',
},
headerTitle__account: 'Profil adatok',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/id-ID.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1348,6 +1348,7 @@ export const idID: LocalizationResource = {
title: undefined,
},
enterpriseAccountsSection: {
primaryButton: 'Hubungkan akun',
title: undefined,
},
headerTitle__account: undefined,
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/is-IS.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1353,6 +1353,7 @@ export const isIS: LocalizationResource = {
title: 'Netföng',
},
enterpriseAccountsSection: {
primaryButton: 'Tengja reikning',
title: 'Fyrirtækjareikningar',
},
headerTitle__account: 'Prófílupplýsingar',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/it-IT.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1359,6 +1359,7 @@ export const itIT: LocalizationResource = {
title: 'Indirizzi email',
},
enterpriseAccountsSection: {
primaryButton: 'Collega account',
title: 'Account aziendali',
},
headerTitle__account: 'Dettagli profilo',
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/large-cameras-talk.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
---
'@clerk/localizations': minor
'@clerk/clerk-js': minor
'@clerk/shared': minor
'@clerk/ui': minor
---

Allow to link external accounts to enterprise accounts via `UserProfile`
5 changes: 5 additions & 0 deletions packages/clerk-js/src/core/resources/EnterpriseAccount.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,6 +61,8 @@ export class EnterpriseAccount extends BaseResource implements EnterpriseAccount
return this;
}

destroy = (): Promise<void> => this._baseDelete();

public __internal_toSnapshot(): EnterpriseAccountJSONSnapshot {
return {
object: 'enterprise_account',
Expand DownExpand Up@@ -93,6 +95,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
protocol!: EnterpriseAccountResource['protocol'];
provider!: EnterpriseAccountResource['provider'];
syncUserAttributes!: boolean;
allowOrganizationAccountLinking!: boolean;
createdAt!: Date;
updatedAt!: Date;
enterpriseConnectionId: string | null = '';
Expand All@@ -114,6 +117,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
this.allowSubdomains = data.allow_subdomains;
this.allowIdpInitiated = data.allow_idp_initiated;
this.disableAdditionalIdentifications = data.disable_additional_identifications;
this.allowOrganizationAccountLinking = data.allow_organization_account_linking;
this.createdAt = unixEpochToDate(data.created_at);
this.updatedAt = unixEpochToDate(data.updated_at);
this.enterpriseConnectionId = data.enterprise_connection_id;
Expand All@@ -136,6 +140,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
allow_subdomains: this.allowSubdomains,
allow_idp_initiated: this.allowIdpInitiated,
disable_additional_identifications: this.disableAdditionalIdentifications,
allow_organization_account_linking: this.allowOrganizationAccountLinking,
enterprise_connection_id: this.enterpriseConnectionId,
created_at: this.createdAt.getTime(),
updated_at: this.updatedAt.getTime(),
Expand Down
29 changes: 28 additions & 1 deletion packages/clerk-js/src/core/resources/User.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,9 +9,12 @@ import type {
DeletedObjectJSON,
DeletedObjectResource,
EmailAddressResource,
EnterpriseAccountConnectionJSON,
EnterpriseAccountConnectionResource,
EnterpriseAccountResource,
ExternalAccountJSON,
ExternalAccountResource,
GetEnterpriseConnectionsParams,
GetOrganizationMemberships,
GetUserOrganizationInvitationsParams,
GetUserOrganizationSuggestionsParams,
Expand DownExpand Up@@ -42,6 +45,7 @@ import {
DeletedObject,
EmailAddress,
EnterpriseAccount,
EnterpriseAccountConnection,
ExternalAccount,
Image,
OrganizationMembership,
Expand DownExpand Up@@ -156,7 +160,7 @@ export class User extends BaseResource implements UserResource {
};

createExternalAccount = async (params: CreateExternalAccountParams): Promise<ExternalAccountResource> => {
const { strategy, redirectUrl, additionalScopes } = params || {};
const { strategy, redirectUrl, additionalScopes, enterpriseConnectionId } = params || {};

const json = (
await BaseResource._fetch<ExternalAccountJSON>({
Expand All@@ -166,6 +170,7 @@ export class User extends BaseResource implements UserResource {
strategy,
redirect_url: redirectUrl,
additional_scope: additionalScopes,
enterprise_connection_id: enterpriseConnectionId,
} as any,
})
)?.response as unknown as ExternalAccountJSON;
Expand DownExpand Up@@ -289,6 +294,28 @@ export class User extends BaseResource implements UserResource {
return new DeletedObject(json);
};

getEnterpriseConnections = async (
params?: GetEnterpriseConnectionsParams,
): Promise<EnterpriseAccountConnectionResource[]> => {
const { withOrganizationAccountLinking } = params || {};

const json = (
await BaseResource._fetch({
path: '/me/enterprise_connections',
method: 'GET',
...(withOrganizationAccountLinking !== undefined
? {
search: {
with_organization_account_linking: String(withOrganizationAccountLinking),
},
}
: {}),
})
)?.response as unknown as EnterpriseAccountConnectionJSON[];

return (json || []).map(connection => new EnterpriseAccountConnection(connection));
};

initializePaymentMethod: typeof initializePaymentMethod = params => {
return initializePaymentMethod(params);
};
Expand Down
82 changes: 82 additions & 0 deletions packages/clerk-js/src/core/resources/__tests__/User.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,88 @@ describe('User', () => {
});
});

it('creates an external account with enterprise connection id', async () => {
const externalAccountJSON = {
object: 'external_account',
provider: 'saml_okta',
verification: {
external_verification_redirect_url: 'https://www.example.com',
},
};

// @ts-ignore
BaseResource._fetch = vi.fn().mockReturnValue(Promise.resolve({ response: externalAccountJSON }));

const user = new User({
email_addresses: [],
phone_numbers: [],
web3_wallets: [],
external_accounts: [],
} as unknown as UserJSON);

await user.createExternalAccount({
enterpriseConnectionId: 'ec_123',
redirectUrl: 'https://www.example.com',
});

// @ts-ignore
expect(BaseResource._fetch).toHaveBeenCalledWith({
method: 'POST',
path: '/me/external_accounts',
body: {
strategy: undefined,
redirect_url: 'https://www.example.com',
additional_scope: undefined,
enterprise_connection_id: 'ec_123',
},
});
});

it('fetches enterprise connections', async () => {
const enterpriseConnectionsJSON = [
{
id: 'ec_123',
object: 'enterprise_account_connection',
name: 'Acme Corp SSO',
active: true,
allow_organization_account_linking: true,
domain: 'acme.com',
protocol: 'saml',
provider: 'saml_okta',
logo_public_url: null,
sync_user_attributes: true,
allow_subdomains: false,
allow_idp_initiated: false,
disable_additional_identifications: false,
enterprise_connection_id: 'ec_123',
created_at: 1234567890,
updated_at: 1234567890,
},
];

// @ts-ignore
BaseResource._fetch = vi.fn().mockReturnValue(Promise.resolve({ response: enterpriseConnectionsJSON }));

const user = new User({
email_addresses: [],
phone_numbers: [],
web3_wallets: [],
external_accounts: [],
} as unknown as UserJSON);

const connections = await user.getEnterpriseConnections();

// @ts-ignore
expect(BaseResource._fetch).toHaveBeenCalledWith({
method: 'GET',
path: '/me/enterprise_connections',
});

expect(connections).toHaveLength(1);
expect(connections[0].name).toBe('Acme Corp SSO');
expect(connections[0].allowOrganizationAccountLinking).toBe(true);
});

it('creates a web3 wallet', async () => {
const targetWeb3Wallet = '0x0000000000000000000000000000000000000000';
const web3WalletJSON = {
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ar-SA.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1338,6 +1338,7 @@ export const arSA: LocalizationResource = {
title: 'العنوان الإلكتروني',
},
enterpriseAccountsSection: {
primaryButton: 'ربط حساب',
title: 'حساب المؤسسات',
},
headerTitle__account: 'الحساب',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/be-BY.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1357,6 +1357,7 @@ export const beBY: LocalizationResource = {
title: 'Адрасы электроннай пошты',
},
enterpriseAccountsSection: {
primaryButton: 'Падключыць уліковы запіс',
title: 'Enterprise accounts',
},
headerTitle__account: 'Уліковы запіс',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/bg-BG.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1348,6 +1348,7 @@ export const bgBG: LocalizationResource = {
title: 'Имейл адреси',
},
enterpriseAccountsSection: {
primaryButton: 'Свържи акаунт',
title: 'Корпоративни акаунти',
},
headerTitle__account: 'Профил',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/bn-IN.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1359,6 +1359,7 @@ export const bnIN: LocalizationResource = {
title: 'ইমেইল ঠিকানা',
},
enterpriseAccountsSection: {
primaryButton: 'অ্যাকাউন্ট সংযুক্ত করুন',
title: 'এন্টারপ্রাইজ অ্যাকাউন্ট',
},
headerTitle__account: 'প্রোফাইল বিবরণ',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ca-ES.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1354,6 +1354,7 @@ export const caES: LocalizationResource = {
title: 'Adreces de correu electrònic',
},
enterpriseAccountsSection: {
primaryButton: 'Connecta compte',
title: "Comptes d'empresa",
},
headerTitle__account: 'Detalls del perfil',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/cs-CZ.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1361,6 +1361,7 @@ export const csCZ: LocalizationResource = {
title: 'E-mailové adresy',
},
enterpriseAccountsSection: {
primaryButton: 'Připojit účet',
title: 'Podnikové účty',
},
headerTitle__account: 'Podrobnosti profilu',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/da-DK.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1345,6 +1345,7 @@ export const daDK: LocalizationResource = {
title: 'E-mailadresser',
},
enterpriseAccountsSection: {
primaryButton: 'Tilknyt konto',
title: 'Virksomhedskonti',
},
headerTitle__account: 'Konto',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/de-DE.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1383,6 +1383,7 @@ export const deDE: LocalizationResource = {
title: 'E-Mail-Adressen',
},
enterpriseAccountsSection: {
primaryButton: 'Konto verbinden',
title: 'Unternehmens-Konten',
},
headerTitle__account: 'Konto',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/el-GR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1374,6 +1374,7 @@ export const elGR: LocalizationResource = {
title: 'Διευθύνσεις email',
},
enterpriseAccountsSection: {
primaryButton: 'Σύνδεση λογαριασμού',
title: 'Επιχειρησιακοί λογαριασμοί',
},
headerTitle__account: 'Λογαριασμός',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/en-GB.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1352,6 +1352,7 @@ export const enGB: LocalizationResource = {
title: 'Email addresses',
},
enterpriseAccountsSection: {
primaryButton: 'Connect account',
title: 'Enterprise accounts',
},
headerTitle__account: 'Profile details',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/en-US.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1360,6 +1360,7 @@ export const enUS: LocalizationResource = {
title: 'Email addresses',
},
enterpriseAccountsSection: {
primaryButton: 'Connect account',
title: 'Enterprise accounts',
},
headerTitle__account: 'Profile details',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-CR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1362,6 +1362,7 @@ export const esCR: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas de empresa',
},
headerTitle__account: 'Detalles de la cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-ES.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const esES: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas empresariales',
},
headerTitle__account: 'Cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-MX.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const esMX: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas de empresa',
},
headerTitle__account: 'Detalles de la cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-UY.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1362,6 +1362,7 @@ export const esUY: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas empresariales',
},
headerTitle__account: 'Detalles del perfil',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fa-IR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1357,6 +1357,7 @@ export const faIR: LocalizationResource = {
title: 'آدرس های ایمیل',
},
enterpriseAccountsSection: {
primaryButton: 'اتصال حساب',
title: 'حساب های سازمانی',
},
headerTitle__account: 'جزئیات نمایه',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fi-FI.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const fiFI: LocalizationResource = {
title: 'Sähköpostiosoitteet',
},
enterpriseAccountsSection: {
primaryButton: 'Yhdistä tili',
title: 'Yritystilit',
},
headerTitle__account: 'Tili',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fr-FR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1372,6 +1372,7 @@ export const frFR: LocalizationResource = {
title: 'Adresses e-mail',
},
enterpriseAccountsSection: {
primaryButton: 'Connecter un compte',
title: 'Comptes entreprises',
},
headerTitle__account: 'Compte',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/he-IL.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1325,6 +1325,7 @@ export const heIL: LocalizationResource = {
title: 'כתובת אימייל',
},
enterpriseAccountsSection: {
primaryButton: 'חבר חשבון',
title: 'חשבונות ארגוניים',
},
headerTitle__account: 'חשבון',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hi-IN.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1360,6 +1360,7 @@ export const hiIN: LocalizationResource = {
title: 'ईमेल पते',
},
enterpriseAccountsSection: {
primaryButton: 'खाता कनेक्ट करें',
title: 'एंटरप्राइज खाते',
},
headerTitle__account: 'प्रोफ़ाइल विवरण',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hr-HR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1353,6 +1353,7 @@ export const hrHR: LocalizationResource = {
title: 'Adrese e-pošte',
},
enterpriseAccountsSection: {
primaryButton: 'Poveži račun',
title: 'Poslovni računi',
},
headerTitle__account: 'Detalji profila',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hu-HU.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1350,6 +1350,7 @@ export const huHU: LocalizationResource = {
title: 'Email címek',
},
enterpriseAccountsSection: {
primaryButton: 'Fiók összekötése',
title: 'Vállalati fiókok',
},
headerTitle__account: 'Profil adatok',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/id-ID.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1348,6 +1348,7 @@ export const idID: LocalizationResource = {
title: undefined,
},
enterpriseAccountsSection: {
primaryButton: 'Hubungkan akun',
title: undefined,
},
headerTitle__account: undefined,
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/is-IS.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1353,6 +1353,7 @@ export const isIS: LocalizationResource = {
title: 'Netföng',
},
enterpriseAccountsSection: {
primaryButton: 'Tengja reikning',
title: 'Fyrirtækjareikningar',
},
headerTitle__account: 'Prófílupplýsingar',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/it-IT.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1359,6 +1359,7 @@ export const itIT: LocalizationResource = {
title: 'Indirizzi email',
},
enterpriseAccountsSection: {
primaryButton: 'Collega account',
title: 'Account aziendali',
},
headerTitle__account: 'Dettagli profilo',
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/large-cameras-talk.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
---
'@clerk/localizations': minor
'@clerk/clerk-js': minor
'@clerk/shared': minor
'@clerk/ui': minor
---

Allow to link external accounts to enterprise accounts via `UserProfile`
5 changes: 5 additions & 0 deletions packages/clerk-js/src/core/resources/EnterpriseAccount.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,6 +61,8 @@ export class EnterpriseAccount extends BaseResource implements EnterpriseAccount
return this;
}

destroy = (): Promise<void> => this._baseDelete();

public __internal_toSnapshot(): EnterpriseAccountJSONSnapshot {
return {
object: 'enterprise_account',
Expand DownExpand Up@@ -93,6 +95,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
protocol!: EnterpriseAccountResource['protocol'];
provider!: EnterpriseAccountResource['provider'];
syncUserAttributes!: boolean;
allowOrganizationAccountLinking!: boolean;
createdAt!: Date;
updatedAt!: Date;
enterpriseConnectionId: string | null = '';
Expand All@@ -114,6 +117,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
this.allowSubdomains = data.allow_subdomains;
this.allowIdpInitiated = data.allow_idp_initiated;
this.disableAdditionalIdentifications = data.disable_additional_identifications;
this.allowOrganizationAccountLinking = data.allow_organization_account_linking;
this.createdAt = unixEpochToDate(data.created_at);
this.updatedAt = unixEpochToDate(data.updated_at);
this.enterpriseConnectionId = data.enterprise_connection_id;
Expand All@@ -136,6 +140,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
allow_subdomains: this.allowSubdomains,
allow_idp_initiated: this.allowIdpInitiated,
disable_additional_identifications: this.disableAdditionalIdentifications,
allow_organization_account_linking: this.allowOrganizationAccountLinking,
enterprise_connection_id: this.enterpriseConnectionId,
created_at: this.createdAt.getTime(),
updated_at: this.updatedAt.getTime(),
Expand Down
29 changes: 28 additions & 1 deletion packages/clerk-js/src/core/resources/User.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,9 +9,12 @@ import type {
DeletedObjectJSON,
DeletedObjectResource,
EmailAddressResource,
EnterpriseAccountConnectionJSON,
EnterpriseAccountConnectionResource,
EnterpriseAccountResource,
ExternalAccountJSON,
ExternalAccountResource,
GetEnterpriseConnectionsParams,
GetOrganizationMemberships,
GetUserOrganizationInvitationsParams,
GetUserOrganizationSuggestionsParams,
Expand DownExpand Up@@ -42,6 +45,7 @@ import {
DeletedObject,
EmailAddress,
EnterpriseAccount,
EnterpriseAccountConnection,
ExternalAccount,
Image,
OrganizationMembership,
Expand DownExpand Up@@ -156,7 +160,7 @@ export class User extends BaseResource implements UserResource {
};

createExternalAccount = async (params: CreateExternalAccountParams): Promise<ExternalAccountResource> => {
const { strategy, redirectUrl, additionalScopes } = params || {};
const { strategy, redirectUrl, additionalScopes, enterpriseConnectionId } = params || {};

const json = (
await BaseResource._fetch<ExternalAccountJSON>({
Expand All@@ -166,6 +170,7 @@ export class User extends BaseResource implements UserResource {
strategy,
redirect_url: redirectUrl,
additional_scope: additionalScopes,
enterprise_connection_id: enterpriseConnectionId,
} as any,
})
)?.response as unknown as ExternalAccountJSON;
Expand DownExpand Up@@ -289,6 +294,28 @@ export class User extends BaseResource implements UserResource {
return new DeletedObject(json);
};

getEnterpriseConnections = async (
params?: GetEnterpriseConnectionsParams,
): Promise<EnterpriseAccountConnectionResource[]> => {
const { withOrganizationAccountLinking } = params || {};

const json = (
await BaseResource._fetch({
path: '/me/enterprise_connections',
method: 'GET',
...(withOrganizationAccountLinking !== undefined
? {
search: {
with_organization_account_linking: String(withOrganizationAccountLinking),
},
}
: {}),
})
)?.response as unknown as EnterpriseAccountConnectionJSON[];

return (json || []).map(connection => new EnterpriseAccountConnection(connection));
};

initializePaymentMethod: typeof initializePaymentMethod = params => {
return initializePaymentMethod(params);
};
Expand Down
82 changes: 82 additions & 0 deletions packages/clerk-js/src/core/resources/__tests__/User.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,88 @@ describe('User', () => {
});
});

it('creates an external account with enterprise connection id', async () => {
const externalAccountJSON = {
object: 'external_account',
provider: 'saml_okta',
verification: {
external_verification_redirect_url: 'https://www.example.com',
},
};

// @ts-ignore
BaseResource._fetch = vi.fn().mockReturnValue(Promise.resolve({ response: externalAccountJSON }));

const user = new User({
email_addresses: [],
phone_numbers: [],
web3_wallets: [],
external_accounts: [],
} as unknown as UserJSON);

await user.createExternalAccount({
enterpriseConnectionId: 'ec_123',
redirectUrl: 'https://www.example.com',
});

// @ts-ignore
expect(BaseResource._fetch).toHaveBeenCalledWith({
method: 'POST',
path: '/me/external_accounts',
body: {
strategy: undefined,
redirect_url: 'https://www.example.com',
additional_scope: undefined,
enterprise_connection_id: 'ec_123',
},
});
});

it('fetches enterprise connections', async () => {
const enterpriseConnectionsJSON = [
{
id: 'ec_123',
object: 'enterprise_account_connection',
name: 'Acme Corp SSO',
active: true,
allow_organization_account_linking: true,
domain: 'acme.com',
protocol: 'saml',
provider: 'saml_okta',
logo_public_url: null,
sync_user_attributes: true,
allow_subdomains: false,
allow_idp_initiated: false,
disable_additional_identifications: false,
enterprise_connection_id: 'ec_123',
created_at: 1234567890,
updated_at: 1234567890,
},
];

// @ts-ignore
BaseResource._fetch = vi.fn().mockReturnValue(Promise.resolve({ response: enterpriseConnectionsJSON }));

const user = new User({
email_addresses: [],
phone_numbers: [],
web3_wallets: [],
external_accounts: [],
} as unknown as UserJSON);

const connections = await user.getEnterpriseConnections();

// @ts-ignore
expect(BaseResource._fetch).toHaveBeenCalledWith({
method: 'GET',
path: '/me/enterprise_connections',
});

expect(connections).toHaveLength(1);
expect(connections[0].name).toBe('Acme Corp SSO');
expect(connections[0].allowOrganizationAccountLinking).toBe(true);
});

it('creates a web3 wallet', async () => {
const targetWeb3Wallet = '0x0000000000000000000000000000000000000000';
const web3WalletJSON = {
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ar-SA.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1338,6 +1338,7 @@ export const arSA: LocalizationResource = {
title: 'العنوان الإلكتروني',
},
enterpriseAccountsSection: {
primaryButton: 'ربط حساب',
title: 'حساب المؤسسات',
},
headerTitle__account: 'الحساب',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/be-BY.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1357,6 +1357,7 @@ export const beBY: LocalizationResource = {
title: 'Адрасы электроннай пошты',
},
enterpriseAccountsSection: {
primaryButton: 'Падключыць уліковы запіс',
title: 'Enterprise accounts',
},
headerTitle__account: 'Уліковы запіс',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/bg-BG.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1348,6 +1348,7 @@ export const bgBG: LocalizationResource = {
title: 'Имейл адреси',
},
enterpriseAccountsSection: {
primaryButton: 'Свържи акаунт',
title: 'Корпоративни акаунти',
},
headerTitle__account: 'Профил',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/bn-IN.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1359,6 +1359,7 @@ export const bnIN: LocalizationResource = {
title: 'ইমেইল ঠিকানা',
},
enterpriseAccountsSection: {
primaryButton: 'অ্যাকাউন্ট সংযুক্ত করুন',
title: 'এন্টারপ্রাইজ অ্যাকাউন্ট',
},
headerTitle__account: 'প্রোফাইল বিবরণ',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ca-ES.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1354,6 +1354,7 @@ export const caES: LocalizationResource = {
title: 'Adreces de correu electrònic',
},
enterpriseAccountsSection: {
primaryButton: 'Connecta compte',
title: "Comptes d'empresa",
},
headerTitle__account: 'Detalls del perfil',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/cs-CZ.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1361,6 +1361,7 @@ export const csCZ: LocalizationResource = {
title: 'E-mailové adresy',
},
enterpriseAccountsSection: {
primaryButton: 'Připojit účet',
title: 'Podnikové účty',
},
headerTitle__account: 'Podrobnosti profilu',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/da-DK.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1345,6 +1345,7 @@ export const daDK: LocalizationResource = {
title: 'E-mailadresser',
},
enterpriseAccountsSection: {
primaryButton: 'Tilknyt konto',
title: 'Virksomhedskonti',
},
headerTitle__account: 'Konto',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/de-DE.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1383,6 +1383,7 @@ export const deDE: LocalizationResource = {
title: 'E-Mail-Adressen',
},
enterpriseAccountsSection: {
primaryButton: 'Konto verbinden',
title: 'Unternehmens-Konten',
},
headerTitle__account: 'Konto',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/el-GR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1374,6 +1374,7 @@ export const elGR: LocalizationResource = {
title: 'Διευθύνσεις email',
},
enterpriseAccountsSection: {
primaryButton: 'Σύνδεση λογαριασμού',
title: 'Επιχειρησιακοί λογαριασμοί',
},
headerTitle__account: 'Λογαριασμός',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/en-GB.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1352,6 +1352,7 @@ export const enGB: LocalizationResource = {
title: 'Email addresses',
},
enterpriseAccountsSection: {
primaryButton: 'Connect account',
title: 'Enterprise accounts',
},
headerTitle__account: 'Profile details',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/en-US.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1360,6 +1360,7 @@ export const enUS: LocalizationResource = {
title: 'Email addresses',
},
enterpriseAccountsSection: {
primaryButton: 'Connect account',
title: 'Enterprise accounts',
},
headerTitle__account: 'Profile details',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-CR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1362,6 +1362,7 @@ export const esCR: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas de empresa',
},
headerTitle__account: 'Detalles de la cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-ES.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const esES: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas empresariales',
},
headerTitle__account: 'Cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-MX.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const esMX: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas de empresa',
},
headerTitle__account: 'Detalles de la cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-UY.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1362,6 +1362,7 @@ export const esUY: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas empresariales',
},
headerTitle__account: 'Detalles del perfil',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fa-IR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1357,6 +1357,7 @@ export const faIR: LocalizationResource = {
title: 'آدرس های ایمیل',
},
enterpriseAccountsSection: {
primaryButton: 'اتصال حساب',
title: 'حساب های سازمانی',
},
headerTitle__account: 'جزئیات نمایه',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fi-FI.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const fiFI: LocalizationResource = {
title: 'Sähköpostiosoitteet',
},
enterpriseAccountsSection: {
primaryButton: 'Yhdistä tili',
title: 'Yritystilit',
},
headerTitle__account: 'Tili',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fr-FR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1372,6 +1372,7 @@ export const frFR: LocalizationResource = {
title: 'Adresses e-mail',
},
enterpriseAccountsSection: {
primaryButton: 'Connecter un compte',
title: 'Comptes entreprises',
},
headerTitle__account: 'Compte',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/he-IL.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1325,6 +1325,7 @@ export const heIL: LocalizationResource = {
title: 'כתובת אימייל',
},
enterpriseAccountsSection: {
primaryButton: 'חבר חשבון',
title: 'חשבונות ארגוניים',
},
headerTitle__account: 'חשבון',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hi-IN.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1360,6 +1360,7 @@ export const hiIN: LocalizationResource = {
title: 'ईमेल पते',
},
enterpriseAccountsSection: {
primaryButton: 'खाता कनेक्ट करें',
title: 'एंटरप्राइज खाते',
},
headerTitle__account: 'प्रोफ़ाइल विवरण',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hr-HR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1353,6 +1353,7 @@ export const hrHR: LocalizationResource = {
title: 'Adrese e-pošte',
},
enterpriseAccountsSection: {
primaryButton: 'Poveži račun',
title: 'Poslovni računi',
},
headerTitle__account: 'Detalji profila',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hu-HU.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1350,6 +1350,7 @@ export const huHU: LocalizationResource = {
title: 'Email címek',
},
enterpriseAccountsSection: {
primaryButton: 'Fiók összekötése',
title: 'Vállalati fiókok',
},
headerTitle__account: 'Profil adatok',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/id-ID.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1348,6 +1348,7 @@ export const idID: LocalizationResource = {
title: undefined,
},
enterpriseAccountsSection: {
primaryButton: 'Hubungkan akun',
title: undefined,
},
headerTitle__account: undefined,
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/is-IS.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1353,6 +1353,7 @@ export const isIS: LocalizationResource = {
title: 'Netföng',
},
enterpriseAccountsSection: {
primaryButton: 'Tengja reikning',
title: 'Fyrirtækjareikningar',
},
headerTitle__account: 'Prófílupplýsingar',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/it-IT.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1359,6 +1359,7 @@ export const itIT: LocalizationResource = {
title: 'Indirizzi email',
},
enterpriseAccountsSection: {
primaryButton: 'Collega account',
title: 'Account aziendali',
},
headerTitle__account: 'Dettagli profilo',
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/large-cameras-talk.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
---
'@clerk/localizations': minor
'@clerk/clerk-js': minor
'@clerk/shared': minor
'@clerk/ui': minor
---

Allow to link external accounts to enterprise accounts via `UserProfile`
5 changes: 5 additions & 0 deletions packages/clerk-js/src/core/resources/EnterpriseAccount.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,6 +61,8 @@ export class EnterpriseAccount extends BaseResource implements EnterpriseAccount
return this;
}

destroy = (): Promise<void> => this._baseDelete();

public __internal_toSnapshot(): EnterpriseAccountJSONSnapshot {
return {
object: 'enterprise_account',
Expand DownExpand Up@@ -93,6 +95,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
protocol!: EnterpriseAccountResource['protocol'];
provider!: EnterpriseAccountResource['provider'];
syncUserAttributes!: boolean;
allowOrganizationAccountLinking!: boolean;
createdAt!: Date;
updatedAt!: Date;
enterpriseConnectionId: string | null = '';
Expand All@@ -114,6 +117,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
this.allowSubdomains = data.allow_subdomains;
this.allowIdpInitiated = data.allow_idp_initiated;
this.disableAdditionalIdentifications = data.disable_additional_identifications;
this.allowOrganizationAccountLinking = data.allow_organization_account_linking;
this.createdAt = unixEpochToDate(data.created_at);
this.updatedAt = unixEpochToDate(data.updated_at);
this.enterpriseConnectionId = data.enterprise_connection_id;
Expand All@@ -136,6 +140,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
allow_subdomains: this.allowSubdomains,
allow_idp_initiated: this.allowIdpInitiated,
disable_additional_identifications: this.disableAdditionalIdentifications,
allow_organization_account_linking: this.allowOrganizationAccountLinking,
enterprise_connection_id: this.enterpriseConnectionId,
created_at: this.createdAt.getTime(),
updated_at: this.updatedAt.getTime(),
Expand Down
29 changes: 28 additions & 1 deletion packages/clerk-js/src/core/resources/User.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,9 +9,12 @@ import type {
DeletedObjectJSON,
DeletedObjectResource,
EmailAddressResource,
EnterpriseAccountConnectionJSON,
EnterpriseAccountConnectionResource,
EnterpriseAccountResource,
ExternalAccountJSON,
ExternalAccountResource,
GetEnterpriseConnectionsParams,
GetOrganizationMemberships,
GetUserOrganizationInvitationsParams,
GetUserOrganizationSuggestionsParams,
Expand DownExpand Up@@ -42,6 +45,7 @@ import {
DeletedObject,
EmailAddress,
EnterpriseAccount,
EnterpriseAccountConnection,
ExternalAccount,
Image,
OrganizationMembership,
Expand DownExpand Up@@ -156,7 +160,7 @@ export class User extends BaseResource implements UserResource {
};

createExternalAccount = async (params: CreateExternalAccountParams): Promise<ExternalAccountResource> => {
const { strategy, redirectUrl, additionalScopes } = params || {};
const { strategy, redirectUrl, additionalScopes, enterpriseConnectionId } = params || {};

const json = (
await BaseResource._fetch<ExternalAccountJSON>({
Expand All@@ -166,6 +170,7 @@ export class User extends BaseResource implements UserResource {
strategy,
redirect_url: redirectUrl,
additional_scope: additionalScopes,
enterprise_connection_id: enterpriseConnectionId,
} as any,
})
)?.response as unknown as ExternalAccountJSON;
Expand DownExpand Up@@ -289,6 +294,28 @@ export class User extends BaseResource implements UserResource {
return new DeletedObject(json);
};

getEnterpriseConnections = async (
params?: GetEnterpriseConnectionsParams,
): Promise<EnterpriseAccountConnectionResource[]> => {
const { withOrganizationAccountLinking } = params || {};

const json = (
await BaseResource._fetch({
path: '/me/enterprise_connections',
method: 'GET',
...(withOrganizationAccountLinking !== undefined
? {
search: {
with_organization_account_linking: String(withOrganizationAccountLinking),
},
}
: {}),
})
)?.response as unknown as EnterpriseAccountConnectionJSON[];

return (json || []).map(connection => new EnterpriseAccountConnection(connection));
};

initializePaymentMethod: typeof initializePaymentMethod = params => {
return initializePaymentMethod(params);
};
Expand Down
82 changes: 82 additions & 0 deletions packages/clerk-js/src/core/resources/__tests__/User.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,88 @@ describe('User', () => {
});
});

it('creates an external account with enterprise connection id', async () => {
const externalAccountJSON = {
object: 'external_account',
provider: 'saml_okta',
verification: {
external_verification_redirect_url: 'https://www.example.com',
},
};

// @ts-ignore
BaseResource._fetch = vi.fn().mockReturnValue(Promise.resolve({ response: externalAccountJSON }));

const user = new User({
email_addresses: [],
phone_numbers: [],
web3_wallets: [],
external_accounts: [],
} as unknown as UserJSON);

await user.createExternalAccount({
enterpriseConnectionId: 'ec_123',
redirectUrl: 'https://www.example.com',
});

// @ts-ignore
expect(BaseResource._fetch).toHaveBeenCalledWith({
method: 'POST',
path: '/me/external_accounts',
body: {
strategy: undefined,
redirect_url: 'https://www.example.com',
additional_scope: undefined,
enterprise_connection_id: 'ec_123',
},
});
});

it('fetches enterprise connections', async () => {
const enterpriseConnectionsJSON = [
{
id: 'ec_123',
object: 'enterprise_account_connection',
name: 'Acme Corp SSO',
active: true,
allow_organization_account_linking: true,
domain: 'acme.com',
protocol: 'saml',
provider: 'saml_okta',
logo_public_url: null,
sync_user_attributes: true,
allow_subdomains: false,
allow_idp_initiated: false,
disable_additional_identifications: false,
enterprise_connection_id: 'ec_123',
created_at: 1234567890,
updated_at: 1234567890,
},
];

// @ts-ignore
BaseResource._fetch = vi.fn().mockReturnValue(Promise.resolve({ response: enterpriseConnectionsJSON }));

const user = new User({
email_addresses: [],
phone_numbers: [],
web3_wallets: [],
external_accounts: [],
} as unknown as UserJSON);

const connections = await user.getEnterpriseConnections();

// @ts-ignore
expect(BaseResource._fetch).toHaveBeenCalledWith({
method: 'GET',
path: '/me/enterprise_connections',
});

expect(connections).toHaveLength(1);
expect(connections[0].name).toBe('Acme Corp SSO');
expect(connections[0].allowOrganizationAccountLinking).toBe(true);
});

it('creates a web3 wallet', async () => {
const targetWeb3Wallet = '0x0000000000000000000000000000000000000000';
const web3WalletJSON = {
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ar-SA.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1338,6 +1338,7 @@ export const arSA: LocalizationResource = {
title: 'العنوان الإلكتروني',
},
enterpriseAccountsSection: {
primaryButton: 'ربط حساب',
title: 'حساب المؤسسات',
},
headerTitle__account: 'الحساب',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/be-BY.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1357,6 +1357,7 @@ export const beBY: LocalizationResource = {
title: 'Адрасы электроннай пошты',
},
enterpriseAccountsSection: {
primaryButton: 'Падключыць уліковы запіс',
title: 'Enterprise accounts',
},
headerTitle__account: 'Уліковы запіс',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/bg-BG.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1348,6 +1348,7 @@ export const bgBG: LocalizationResource = {
title: 'Имейл адреси',
},
enterpriseAccountsSection: {
primaryButton: 'Свържи акаунт',
title: 'Корпоративни акаунти',
},
headerTitle__account: 'Профил',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/bn-IN.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1359,6 +1359,7 @@ export const bnIN: LocalizationResource = {
title: 'ইমেইল ঠিকানা',
},
enterpriseAccountsSection: {
primaryButton: 'অ্যাকাউন্ট সংযুক্ত করুন',
title: 'এন্টারপ্রাইজ অ্যাকাউন্ট',
},
headerTitle__account: 'প্রোফাইল বিবরণ',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ca-ES.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1354,6 +1354,7 @@ export const caES: LocalizationResource = {
title: 'Adreces de correu electrònic',
},
enterpriseAccountsSection: {
primaryButton: 'Connecta compte',
title: "Comptes d'empresa",
},
headerTitle__account: 'Detalls del perfil',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/cs-CZ.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1361,6 +1361,7 @@ export const csCZ: LocalizationResource = {
title: 'E-mailové adresy',
},
enterpriseAccountsSection: {
primaryButton: 'Připojit účet',
title: 'Podnikové účty',
},
headerTitle__account: 'Podrobnosti profilu',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/da-DK.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1345,6 +1345,7 @@ export const daDK: LocalizationResource = {
title: 'E-mailadresser',
},
enterpriseAccountsSection: {
primaryButton: 'Tilknyt konto',
title: 'Virksomhedskonti',
},
headerTitle__account: 'Konto',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/de-DE.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1383,6 +1383,7 @@ export const deDE: LocalizationResource = {
title: 'E-Mail-Adressen',
},
enterpriseAccountsSection: {
primaryButton: 'Konto verbinden',
title: 'Unternehmens-Konten',
},
headerTitle__account: 'Konto',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/el-GR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1374,6 +1374,7 @@ export const elGR: LocalizationResource = {
title: 'Διευθύνσεις email',
},
enterpriseAccountsSection: {
primaryButton: 'Σύνδεση λογαριασμού',
title: 'Επιχειρησιακοί λογαριασμοί',
},
headerTitle__account: 'Λογαριασμός',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/en-GB.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1352,6 +1352,7 @@ export const enGB: LocalizationResource = {
title: 'Email addresses',
},
enterpriseAccountsSection: {
primaryButton: 'Connect account',
title: 'Enterprise accounts',
},
headerTitle__account: 'Profile details',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/en-US.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1360,6 +1360,7 @@ export const enUS: LocalizationResource = {
title: 'Email addresses',
},
enterpriseAccountsSection: {
primaryButton: 'Connect account',
title: 'Enterprise accounts',
},
headerTitle__account: 'Profile details',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-CR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1362,6 +1362,7 @@ export const esCR: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas de empresa',
},
headerTitle__account: 'Detalles de la cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-ES.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const esES: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas empresariales',
},
headerTitle__account: 'Cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-MX.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const esMX: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas de empresa',
},
headerTitle__account: 'Detalles de la cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-UY.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1362,6 +1362,7 @@ export const esUY: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas empresariales',
},
headerTitle__account: 'Detalles del perfil',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fa-IR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1357,6 +1357,7 @@ export const faIR: LocalizationResource = {
title: 'آدرس های ایمیل',
},
enterpriseAccountsSection: {
primaryButton: 'اتصال حساب',
title: 'حساب های سازمانی',
},
headerTitle__account: 'جزئیات نمایه',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fi-FI.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const fiFI: LocalizationResource = {
title: 'Sähköpostiosoitteet',
},
enterpriseAccountsSection: {
primaryButton: 'Yhdistä tili',
title: 'Yritystilit',
},
headerTitle__account: 'Tili',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fr-FR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1372,6 +1372,7 @@ export const frFR: LocalizationResource = {
title: 'Adresses e-mail',
},
enterpriseAccountsSection: {
primaryButton: 'Connecter un compte',
title: 'Comptes entreprises',
},
headerTitle__account: 'Compte',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/he-IL.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1325,6 +1325,7 @@ export const heIL: LocalizationResource = {
title: 'כתובת אימייל',
},
enterpriseAccountsSection: {
primaryButton: 'חבר חשבון',
title: 'חשבונות ארגוניים',
},
headerTitle__account: 'חשבון',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hi-IN.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1360,6 +1360,7 @@ export const hiIN: LocalizationResource = {
title: 'ईमेल पते',
},
enterpriseAccountsSection: {
primaryButton: 'खाता कनेक्ट करें',
title: 'एंटरप्राइज खाते',
},
headerTitle__account: 'प्रोफ़ाइल विवरण',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hr-HR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1353,6 +1353,7 @@ export const hrHR: LocalizationResource = {
title: 'Adrese e-pošte',
},
enterpriseAccountsSection: {
primaryButton: 'Poveži račun',
title: 'Poslovni računi',
},
headerTitle__account: 'Detalji profila',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hu-HU.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1350,6 +1350,7 @@ export const huHU: LocalizationResource = {
title: 'Email címek',
},
enterpriseAccountsSection: {
primaryButton: 'Fiók összekötése',
title: 'Vállalati fiókok',
},
headerTitle__account: 'Profil adatok',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/id-ID.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1348,6 +1348,7 @@ export const idID: LocalizationResource = {
title: undefined,
},
enterpriseAccountsSection: {
primaryButton: 'Hubungkan akun',
title: undefined,
},
headerTitle__account: undefined,
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/is-IS.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1353,6 +1353,7 @@ export const isIS: LocalizationResource = {
title: 'Netföng',
},
enterpriseAccountsSection: {
primaryButton: 'Tengja reikning',
title: 'Fyrirtækjareikningar',
},
headerTitle__account: 'Prófílupplýsingar',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/it-IT.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1359,6 +1359,7 @@ export const itIT: LocalizationResource = {
title: 'Indirizzi email',
},
enterpriseAccountsSection: {
primaryButton: 'Collega account',
title: 'Account aziendali',
},
headerTitle__account: 'Dettagli profilo',
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/large-cameras-talk.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
---
'@clerk/localizations': minor
'@clerk/clerk-js': minor
'@clerk/shared': minor
'@clerk/ui': minor
---

Allow to link external accounts to enterprise accounts via `UserProfile`
5 changes: 5 additions & 0 deletions packages/clerk-js/src/core/resources/EnterpriseAccount.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,6 +61,8 @@ export class EnterpriseAccount extends BaseResource implements EnterpriseAccount
return this;
}

destroy = (): Promise<void> => this._baseDelete();

public __internal_toSnapshot(): EnterpriseAccountJSONSnapshot {
return {
object: 'enterprise_account',
Expand DownExpand Up@@ -93,6 +95,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
protocol!: EnterpriseAccountResource['protocol'];
provider!: EnterpriseAccountResource['provider'];
syncUserAttributes!: boolean;
allowOrganizationAccountLinking!: boolean;
createdAt!: Date;
updatedAt!: Date;
enterpriseConnectionId: string | null = '';
Expand All@@ -114,6 +117,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
this.allowSubdomains = data.allow_subdomains;
this.allowIdpInitiated = data.allow_idp_initiated;
this.disableAdditionalIdentifications = data.disable_additional_identifications;
this.allowOrganizationAccountLinking = data.allow_organization_account_linking;
this.createdAt = unixEpochToDate(data.created_at);
this.updatedAt = unixEpochToDate(data.updated_at);
this.enterpriseConnectionId = data.enterprise_connection_id;
Expand All@@ -136,6 +140,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
allow_subdomains: this.allowSubdomains,
allow_idp_initiated: this.allowIdpInitiated,
disable_additional_identifications: this.disableAdditionalIdentifications,
allow_organization_account_linking: this.allowOrganizationAccountLinking,
enterprise_connection_id: this.enterpriseConnectionId,
created_at: this.createdAt.getTime(),
updated_at: this.updatedAt.getTime(),
Expand Down
29 changes: 28 additions & 1 deletion packages/clerk-js/src/core/resources/User.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,9 +9,12 @@ import type {
DeletedObjectJSON,
DeletedObjectResource,
EmailAddressResource,
EnterpriseAccountConnectionJSON,
EnterpriseAccountConnectionResource,
EnterpriseAccountResource,
ExternalAccountJSON,
ExternalAccountResource,
GetEnterpriseConnectionsParams,
GetOrganizationMemberships,
GetUserOrganizationInvitationsParams,
GetUserOrganizationSuggestionsParams,
Expand DownExpand Up@@ -42,6 +45,7 @@ import {
DeletedObject,
EmailAddress,
EnterpriseAccount,
EnterpriseAccountConnection,
ExternalAccount,
Image,
OrganizationMembership,
Expand DownExpand Up@@ -156,7 +160,7 @@ export class User extends BaseResource implements UserResource {
};

createExternalAccount = async (params: CreateExternalAccountParams): Promise<ExternalAccountResource> => {
const { strategy, redirectUrl, additionalScopes } = params || {};
const { strategy, redirectUrl, additionalScopes, enterpriseConnectionId } = params || {};

const json = (
await BaseResource._fetch<ExternalAccountJSON>({
Expand All@@ -166,6 +170,7 @@ export class User extends BaseResource implements UserResource {
strategy,
redirect_url: redirectUrl,
additional_scope: additionalScopes,
enterprise_connection_id: enterpriseConnectionId,
} as any,
})
)?.response as unknown as ExternalAccountJSON;
Expand DownExpand Up@@ -289,6 +294,28 @@ export class User extends BaseResource implements UserResource {
return new DeletedObject(json);
};

getEnterpriseConnections = async (
params?: GetEnterpriseConnectionsParams,
): Promise<EnterpriseAccountConnectionResource[]> => {
const { withOrganizationAccountLinking } = params || {};

const json = (
await BaseResource._fetch({
path: '/me/enterprise_connections',
method: 'GET',
...(withOrganizationAccountLinking !== undefined
? {
search: {
with_organization_account_linking: String(withOrganizationAccountLinking),
},
}
: {}),
})
)?.response as unknown as EnterpriseAccountConnectionJSON[];

return (json || []).map(connection => new EnterpriseAccountConnection(connection));
};

initializePaymentMethod: typeof initializePaymentMethod = params => {
return initializePaymentMethod(params);
};
Expand Down
82 changes: 82 additions & 0 deletions packages/clerk-js/src/core/resources/__tests__/User.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,88 @@ describe('User', () => {
});
});

it('creates an external account with enterprise connection id', async () => {
const externalAccountJSON = {
object: 'external_account',
provider: 'saml_okta',
verification: {
external_verification_redirect_url: 'https://www.example.com',
},
};

// @ts-ignore
BaseResource._fetch = vi.fn().mockReturnValue(Promise.resolve({ response: externalAccountJSON }));

const user = new User({
email_addresses: [],
phone_numbers: [],
web3_wallets: [],
external_accounts: [],
} as unknown as UserJSON);

await user.createExternalAccount({
enterpriseConnectionId: 'ec_123',
redirectUrl: 'https://www.example.com',
});

// @ts-ignore
expect(BaseResource._fetch).toHaveBeenCalledWith({
method: 'POST',
path: '/me/external_accounts',
body: {
strategy: undefined,
redirect_url: 'https://www.example.com',
additional_scope: undefined,
enterprise_connection_id: 'ec_123',
},
});
});

it('fetches enterprise connections', async () => {
const enterpriseConnectionsJSON = [
{
id: 'ec_123',
object: 'enterprise_account_connection',
name: 'Acme Corp SSO',
active: true,
allow_organization_account_linking: true,
domain: 'acme.com',
protocol: 'saml',
provider: 'saml_okta',
logo_public_url: null,
sync_user_attributes: true,
allow_subdomains: false,
allow_idp_initiated: false,
disable_additional_identifications: false,
enterprise_connection_id: 'ec_123',
created_at: 1234567890,
updated_at: 1234567890,
},
];

// @ts-ignore
BaseResource._fetch = vi.fn().mockReturnValue(Promise.resolve({ response: enterpriseConnectionsJSON }));

const user = new User({
email_addresses: [],
phone_numbers: [],
web3_wallets: [],
external_accounts: [],
} as unknown as UserJSON);

const connections = await user.getEnterpriseConnections();

// @ts-ignore
expect(BaseResource._fetch).toHaveBeenCalledWith({
method: 'GET',
path: '/me/enterprise_connections',
});

expect(connections).toHaveLength(1);
expect(connections[0].name).toBe('Acme Corp SSO');
expect(connections[0].allowOrganizationAccountLinking).toBe(true);
});

it('creates a web3 wallet', async () => {
const targetWeb3Wallet = '0x0000000000000000000000000000000000000000';
const web3WalletJSON = {
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ar-SA.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1338,6 +1338,7 @@ export const arSA: LocalizationResource = {
title: 'العنوان الإلكتروني',
},
enterpriseAccountsSection: {
primaryButton: 'ربط حساب',
title: 'حساب المؤسسات',
},
headerTitle__account: 'الحساب',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/be-BY.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1357,6 +1357,7 @@ export const beBY: LocalizationResource = {
title: 'Адрасы электроннай пошты',
},
enterpriseAccountsSection: {
primaryButton: 'Падключыць уліковы запіс',
title: 'Enterprise accounts',
},
headerTitle__account: 'Уліковы запіс',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/bg-BG.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1348,6 +1348,7 @@ export const bgBG: LocalizationResource = {
title: 'Имейл адреси',
},
enterpriseAccountsSection: {
primaryButton: 'Свържи акаунт',
title: 'Корпоративни акаунти',
},
headerTitle__account: 'Профил',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/bn-IN.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1359,6 +1359,7 @@ export const bnIN: LocalizationResource = {
title: 'ইমেইল ঠিকানা',
},
enterpriseAccountsSection: {
primaryButton: 'অ্যাকাউন্ট সংযুক্ত করুন',
title: 'এন্টারপ্রাইজ অ্যাকাউন্ট',
},
headerTitle__account: 'প্রোফাইল বিবরণ',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ca-ES.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1354,6 +1354,7 @@ export const caES: LocalizationResource = {
title: 'Adreces de correu electrònic',
},
enterpriseAccountsSection: {
primaryButton: 'Connecta compte',
title: "Comptes d'empresa",
},
headerTitle__account: 'Detalls del perfil',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/cs-CZ.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1361,6 +1361,7 @@ export const csCZ: LocalizationResource = {
title: 'E-mailové adresy',
},
enterpriseAccountsSection: {
primaryButton: 'Připojit účet',
title: 'Podnikové účty',
},
headerTitle__account: 'Podrobnosti profilu',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/da-DK.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1345,6 +1345,7 @@ export const daDK: LocalizationResource = {
title: 'E-mailadresser',
},
enterpriseAccountsSection: {
primaryButton: 'Tilknyt konto',
title: 'Virksomhedskonti',
},
headerTitle__account: 'Konto',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/de-DE.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1383,6 +1383,7 @@ export const deDE: LocalizationResource = {
title: 'E-Mail-Adressen',
},
enterpriseAccountsSection: {
primaryButton: 'Konto verbinden',
title: 'Unternehmens-Konten',
},
headerTitle__account: 'Konto',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/el-GR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1374,6 +1374,7 @@ export const elGR: LocalizationResource = {
title: 'Διευθύνσεις email',
},
enterpriseAccountsSection: {
primaryButton: 'Σύνδεση λογαριασμού',
title: 'Επιχειρησιακοί λογαριασμοί',
},
headerTitle__account: 'Λογαριασμός',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/en-GB.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1352,6 +1352,7 @@ export const enGB: LocalizationResource = {
title: 'Email addresses',
},
enterpriseAccountsSection: {
primaryButton: 'Connect account',
title: 'Enterprise accounts',
},
headerTitle__account: 'Profile details',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/en-US.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1360,6 +1360,7 @@ export const enUS: LocalizationResource = {
title: 'Email addresses',
},
enterpriseAccountsSection: {
primaryButton: 'Connect account',
title: 'Enterprise accounts',
},
headerTitle__account: 'Profile details',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-CR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1362,6 +1362,7 @@ export const esCR: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas de empresa',
},
headerTitle__account: 'Detalles de la cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-ES.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const esES: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas empresariales',
},
headerTitle__account: 'Cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-MX.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const esMX: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas de empresa',
},
headerTitle__account: 'Detalles de la cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-UY.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1362,6 +1362,7 @@ export const esUY: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas empresariales',
},
headerTitle__account: 'Detalles del perfil',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fa-IR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1357,6 +1357,7 @@ export const faIR: LocalizationResource = {
title: 'آدرس های ایمیل',
},
enterpriseAccountsSection: {
primaryButton: 'اتصال حساب',
title: 'حساب های سازمانی',
},
headerTitle__account: 'جزئیات نمایه',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fi-FI.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const fiFI: LocalizationResource = {
title: 'Sähköpostiosoitteet',
},
enterpriseAccountsSection: {
primaryButton: 'Yhdistä tili',
title: 'Yritystilit',
},
headerTitle__account: 'Tili',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fr-FR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1372,6 +1372,7 @@ export const frFR: LocalizationResource = {
title: 'Adresses e-mail',
},
enterpriseAccountsSection: {
primaryButton: 'Connecter un compte',
title: 'Comptes entreprises',
},
headerTitle__account: 'Compte',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/he-IL.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1325,6 +1325,7 @@ export const heIL: LocalizationResource = {
title: 'כתובת אימייל',
},
enterpriseAccountsSection: {
primaryButton: 'חבר חשבון',
title: 'חשבונות ארגוניים',
},
headerTitle__account: 'חשבון',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hi-IN.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1360,6 +1360,7 @@ export const hiIN: LocalizationResource = {
title: 'ईमेल पते',
},
enterpriseAccountsSection: {
primaryButton: 'खाता कनेक्ट करें',
title: 'एंटरप्राइज खाते',
},
headerTitle__account: 'प्रोफ़ाइल विवरण',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hr-HR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1353,6 +1353,7 @@ export const hrHR: LocalizationResource = {
title: 'Adrese e-pošte',
},
enterpriseAccountsSection: {
primaryButton: 'Poveži račun',
title: 'Poslovni računi',
},
headerTitle__account: 'Detalji profila',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hu-HU.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1350,6 +1350,7 @@ export const huHU: LocalizationResource = {
title: 'Email címek',
},
enterpriseAccountsSection: {
primaryButton: 'Fiók összekötése',
title: 'Vállalati fiókok',
},
headerTitle__account: 'Profil adatok',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/id-ID.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1348,6 +1348,7 @@ export const idID: LocalizationResource = {
title: undefined,
},
enterpriseAccountsSection: {
primaryButton: 'Hubungkan akun',
title: undefined,
},
headerTitle__account: undefined,
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/is-IS.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1353,6 +1353,7 @@ export const isIS: LocalizationResource = {
title: 'Netföng',
},
enterpriseAccountsSection: {
primaryButton: 'Tengja reikning',
title: 'Fyrirtækjareikningar',
},
headerTitle__account: 'Prófílupplýsingar',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/it-IT.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1359,6 +1359,7 @@ export const itIT: LocalizationResource = {
title: 'Indirizzi email',
},
enterpriseAccountsSection: {
primaryButton: 'Collega account',
title: 'Account aziendali',
},
headerTitle__account: 'Dettagli profilo',
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/large-cameras-talk.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
---
'@clerk/localizations': minor
'@clerk/clerk-js': minor
'@clerk/shared': minor
'@clerk/ui': minor
---

Allow to link external accounts to enterprise accounts via `UserProfile`
5 changes: 5 additions & 0 deletions packages/clerk-js/src/core/resources/EnterpriseAccount.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,6 +61,8 @@ export class EnterpriseAccount extends BaseResource implements EnterpriseAccount
return this;
}

destroy = (): Promise<void> => this._baseDelete();

public __internal_toSnapshot(): EnterpriseAccountJSONSnapshot {
return {
object: 'enterprise_account',
Expand DownExpand Up@@ -93,6 +95,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
protocol!: EnterpriseAccountResource['protocol'];
provider!: EnterpriseAccountResource['provider'];
syncUserAttributes!: boolean;
allowOrganizationAccountLinking!: boolean;
createdAt!: Date;
updatedAt!: Date;
enterpriseConnectionId: string | null = '';
Expand All@@ -114,6 +117,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
this.allowSubdomains = data.allow_subdomains;
this.allowIdpInitiated = data.allow_idp_initiated;
this.disableAdditionalIdentifications = data.disable_additional_identifications;
this.allowOrganizationAccountLinking = data.allow_organization_account_linking;
this.createdAt = unixEpochToDate(data.created_at);
this.updatedAt = unixEpochToDate(data.updated_at);
this.enterpriseConnectionId = data.enterprise_connection_id;
Expand All@@ -136,6 +140,7 @@ export class EnterpriseAccountConnection extends BaseResource implements Enterpr
allow_subdomains: this.allowSubdomains,
allow_idp_initiated: this.allowIdpInitiated,
disable_additional_identifications: this.disableAdditionalIdentifications,
allow_organization_account_linking: this.allowOrganizationAccountLinking,
enterprise_connection_id: this.enterpriseConnectionId,
created_at: this.createdAt.getTime(),
updated_at: this.updatedAt.getTime(),
Expand Down
29 changes: 28 additions & 1 deletion packages/clerk-js/src/core/resources/User.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,9 +9,12 @@ import type {
DeletedObjectJSON,
DeletedObjectResource,
EmailAddressResource,
EnterpriseAccountConnectionJSON,
EnterpriseAccountConnectionResource,
EnterpriseAccountResource,
ExternalAccountJSON,
ExternalAccountResource,
GetEnterpriseConnectionsParams,
GetOrganizationMemberships,
GetUserOrganizationInvitationsParams,
GetUserOrganizationSuggestionsParams,
Expand DownExpand Up@@ -42,6 +45,7 @@ import {
DeletedObject,
EmailAddress,
EnterpriseAccount,
EnterpriseAccountConnection,
ExternalAccount,
Image,
OrganizationMembership,
Expand DownExpand Up@@ -156,7 +160,7 @@ export class User extends BaseResource implements UserResource {
};

createExternalAccount = async (params: CreateExternalAccountParams): Promise<ExternalAccountResource> => {
const { strategy, redirectUrl, additionalScopes } = params || {};
const { strategy, redirectUrl, additionalScopes, enterpriseConnectionId } = params || {};

const json = (
await BaseResource._fetch<ExternalAccountJSON>({
Expand All@@ -166,6 +170,7 @@ export class User extends BaseResource implements UserResource {
strategy,
redirect_url: redirectUrl,
additional_scope: additionalScopes,
enterprise_connection_id: enterpriseConnectionId,
} as any,
})
)?.response as unknown as ExternalAccountJSON;
Expand DownExpand Up@@ -289,6 +294,28 @@ export class User extends BaseResource implements UserResource {
return new DeletedObject(json);
};

getEnterpriseConnections = async (
params?: GetEnterpriseConnectionsParams,
): Promise<EnterpriseAccountConnectionResource[]> => {
const { withOrganizationAccountLinking } = params || {};

const json = (
await BaseResource._fetch({
path: '/me/enterprise_connections',
method: 'GET',
...(withOrganizationAccountLinking !== undefined
? {
search: {
with_organization_account_linking: String(withOrganizationAccountLinking),
},
}
: {}),
})
)?.response as unknown as EnterpriseAccountConnectionJSON[];

return (json || []).map(connection => new EnterpriseAccountConnection(connection));
};

initializePaymentMethod: typeof initializePaymentMethod = params => {
return initializePaymentMethod(params);
};
Expand Down
82 changes: 82 additions & 0 deletions packages/clerk-js/src/core/resources/__tests__/User.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,88 @@ describe('User', () => {
});
});

it('creates an external account with enterprise connection id', async () => {
const externalAccountJSON = {
object: 'external_account',
provider: 'saml_okta',
verification: {
external_verification_redirect_url: 'https://www.example.com',
},
};

// @ts-ignore
BaseResource._fetch = vi.fn().mockReturnValue(Promise.resolve({ response: externalAccountJSON }));

const user = new User({
email_addresses: [],
phone_numbers: [],
web3_wallets: [],
external_accounts: [],
} as unknown as UserJSON);

await user.createExternalAccount({
enterpriseConnectionId: 'ec_123',
redirectUrl: 'https://www.example.com',
});

// @ts-ignore
expect(BaseResource._fetch).toHaveBeenCalledWith({
method: 'POST',
path: '/me/external_accounts',
body: {
strategy: undefined,
redirect_url: 'https://www.example.com',
additional_scope: undefined,
enterprise_connection_id: 'ec_123',
},
});
});

it('fetches enterprise connections', async () => {
const enterpriseConnectionsJSON = [
{
id: 'ec_123',
object: 'enterprise_account_connection',
name: 'Acme Corp SSO',
active: true,
allow_organization_account_linking: true,
domain: 'acme.com',
protocol: 'saml',
provider: 'saml_okta',
logo_public_url: null,
sync_user_attributes: true,
allow_subdomains: false,
allow_idp_initiated: false,
disable_additional_identifications: false,
enterprise_connection_id: 'ec_123',
created_at: 1234567890,
updated_at: 1234567890,
},
];

// @ts-ignore
BaseResource._fetch = vi.fn().mockReturnValue(Promise.resolve({ response: enterpriseConnectionsJSON }));

const user = new User({
email_addresses: [],
phone_numbers: [],
web3_wallets: [],
external_accounts: [],
} as unknown as UserJSON);

const connections = await user.getEnterpriseConnections();

// @ts-ignore
expect(BaseResource._fetch).toHaveBeenCalledWith({
method: 'GET',
path: '/me/enterprise_connections',
});

expect(connections).toHaveLength(1);
expect(connections[0].name).toBe('Acme Corp SSO');
expect(connections[0].allowOrganizationAccountLinking).toBe(true);
});

it('creates a web3 wallet', async () => {
const targetWeb3Wallet = '0x0000000000000000000000000000000000000000';
const web3WalletJSON = {
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ar-SA.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1338,6 +1338,7 @@ export const arSA: LocalizationResource = {
title: 'العنوان الإلكتروني',
},
enterpriseAccountsSection: {
primaryButton: 'ربط حساب',
title: 'حساب المؤسسات',
},
headerTitle__account: 'الحساب',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/be-BY.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1357,6 +1357,7 @@ export const beBY: LocalizationResource = {
title: 'Адрасы электроннай пошты',
},
enterpriseAccountsSection: {
primaryButton: 'Падключыць уліковы запіс',
title: 'Enterprise accounts',
},
headerTitle__account: 'Уліковы запіс',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/bg-BG.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1348,6 +1348,7 @@ export const bgBG: LocalizationResource = {
title: 'Имейл адреси',
},
enterpriseAccountsSection: {
primaryButton: 'Свържи акаунт',
title: 'Корпоративни акаунти',
},
headerTitle__account: 'Профил',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/bn-IN.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1359,6 +1359,7 @@ export const bnIN: LocalizationResource = {
title: 'ইমেইল ঠিকানা',
},
enterpriseAccountsSection: {
primaryButton: 'অ্যাকাউন্ট সংযুক্ত করুন',
title: 'এন্টারপ্রাইজ অ্যাকাউন্ট',
},
headerTitle__account: 'প্রোফাইল বিবরণ',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ca-ES.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1354,6 +1354,7 @@ export const caES: LocalizationResource = {
title: 'Adreces de correu electrònic',
},
enterpriseAccountsSection: {
primaryButton: 'Connecta compte',
title: "Comptes d'empresa",
},
headerTitle__account: 'Detalls del perfil',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/cs-CZ.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1361,6 +1361,7 @@ export const csCZ: LocalizationResource = {
title: 'E-mailové adresy',
},
enterpriseAccountsSection: {
primaryButton: 'Připojit účet',
title: 'Podnikové účty',
},
headerTitle__account: 'Podrobnosti profilu',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/da-DK.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1345,6 +1345,7 @@ export const daDK: LocalizationResource = {
title: 'E-mailadresser',
},
enterpriseAccountsSection: {
primaryButton: 'Tilknyt konto',
title: 'Virksomhedskonti',
},
headerTitle__account: 'Konto',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/de-DE.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1383,6 +1383,7 @@ export const deDE: LocalizationResource = {
title: 'E-Mail-Adressen',
},
enterpriseAccountsSection: {
primaryButton: 'Konto verbinden',
title: 'Unternehmens-Konten',
},
headerTitle__account: 'Konto',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/el-GR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1374,6 +1374,7 @@ export const elGR: LocalizationResource = {
title: 'Διευθύνσεις email',
},
enterpriseAccountsSection: {
primaryButton: 'Σύνδεση λογαριασμού',
title: 'Επιχειρησιακοί λογαριασμοί',
},
headerTitle__account: 'Λογαριασμός',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/en-GB.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1352,6 +1352,7 @@ export const enGB: LocalizationResource = {
title: 'Email addresses',
},
enterpriseAccountsSection: {
primaryButton: 'Connect account',
title: 'Enterprise accounts',
},
headerTitle__account: 'Profile details',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/en-US.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1360,6 +1360,7 @@ export const enUS: LocalizationResource = {
title: 'Email addresses',
},
enterpriseAccountsSection: {
primaryButton: 'Connect account',
title: 'Enterprise accounts',
},
headerTitle__account: 'Profile details',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-CR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1362,6 +1362,7 @@ export const esCR: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas de empresa',
},
headerTitle__account: 'Detalles de la cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-ES.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const esES: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas empresariales',
},
headerTitle__account: 'Cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-MX.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const esMX: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas de empresa',
},
headerTitle__account: 'Detalles de la cuenta',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-UY.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1362,6 +1362,7 @@ export const esUY: LocalizationResource = {
title: 'Correos electrónicos',
},
enterpriseAccountsSection: {
primaryButton: 'Conectar cuenta',
title: 'Cuentas empresariales',
},
headerTitle__account: 'Detalles del perfil',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fa-IR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1357,6 +1357,7 @@ export const faIR: LocalizationResource = {
title: 'آدرس های ایمیل',
},
enterpriseAccountsSection: {
primaryButton: 'اتصال حساب',
title: 'حساب های سازمانی',
},
headerTitle__account: 'جزئیات نمایه',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fi-FI.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1363,6 +1363,7 @@ export const fiFI: LocalizationResource = {
title: 'Sähköpostiosoitteet',
},
enterpriseAccountsSection: {
primaryButton: 'Yhdistä tili',
title: 'Yritystilit',
},
headerTitle__account: 'Tili',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fr-FR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1372,6 +1372,7 @@ export const frFR: LocalizationResource = {
title: 'Adresses e-mail',
},
enterpriseAccountsSection: {
primaryButton: 'Connecter un compte',
title: 'Comptes entreprises',
},
headerTitle__account: 'Compte',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/he-IL.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1325,6 +1325,7 @@ export const heIL: LocalizationResource = {
title: 'כתובת אימייל',
},
enterpriseAccountsSection: {
primaryButton: 'חבר חשבון',
title: 'חשבונות ארגוניים',
},
headerTitle__account: 'חשבון',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hi-IN.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1360,6 +1360,7 @@ export const hiIN: LocalizationResource = {
title: 'ईमेल पते',
},
enterpriseAccountsSection: {
primaryButton: 'खाता कनेक्ट करें',
title: 'एंटरप्राइज खाते',
},
headerTitle__account: 'प्रोफ़ाइल विवरण',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hr-HR.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1353,6 +1353,7 @@ export const hrHR: LocalizationResource = {
title: 'Adrese e-pošte',
},
enterpriseAccountsSection: {
primaryButton: 'Poveži račun',
title: 'Poslovni računi',
},
headerTitle__account: 'Detalji profila',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hu-HU.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1350,6 +1350,7 @@ export const huHU: LocalizationResource = {
title: 'Email címek',
},
enterpriseAccountsSection: {
primaryButton: 'Fiók összekötése',
title: 'Vállalati fiókok',
},
headerTitle__account: 'Profil adatok',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/id-ID.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1348,6 +1348,7 @@ export const idID: LocalizationResource = {
title: undefined,
},
enterpriseAccountsSection: {
primaryButton: 'Hubungkan akun',
title: undefined,
},
headerTitle__account: undefined,
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/is-IS.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1353,6 +1353,7 @@ export const isIS: LocalizationResource = {
title: 'Netföng',
},
enterpriseAccountsSection: {
primaryButton: 'Tengja reikning',
title: 'Fyrirtækjareikningar',
},
headerTitle__account: 'Prófílupplýsingar',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/it-IT.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1359,6 +1359,7 @@ export const itIT: LocalizationResource = {
title: 'Indirizzi email',
},
enterpriseAccountsSection: {
primaryButton: 'Collega account',
title: 'Account aziendali',
},
headerTitle__account: 'Dettagli profilo',
Expand Down
Loading
Loading