Skip to content

Commit

Permalink
fix(clerk-js): Fix broken enterprise connection icon for custom SAML …
Browse files Browse the repository at this point in the history
…provider (#4809)
  • Loading branch information
LauraBeatris authored Dec 19, 2024
1 parent 05c5de9 commit 99f7536
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/friendly-trains-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
---

Fix broken enterprise connection icon for custom SAML provider
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { iconImageUrl } from '@clerk/shared/constants';
import { useUser } from '@clerk/shared/react';
import type { EnterpriseAccountResource, OAuthProvider } from '@clerk/types';

Expand Down Expand Up @@ -83,7 +82,6 @@ const EnterpriseAccount = ({ account }: { account: EnterpriseAccountResource })
const EnterpriseAccountProviderIcon = ({ account }: { account: EnterpriseAccountResource }) => {
const { provider, enterpriseConnection } = account;

const isCustomOAuthProvider = provider.startsWith('oauth_custom_');
const providerWithoutPrefix = provider.replace(/(oauth_|saml_)/, '').trim() as OAuthProvider;
const connectionName = enterpriseConnection?.name ?? providerWithoutPrefix;

Expand All @@ -94,15 +92,6 @@ const EnterpriseAccountProviderIcon = ({ account }: { account: EnterpriseAccount
elementId: descriptors.enterpriseButtonsProviderIcon.setId(account.provider),
};

if (!isCustomOAuthProvider) {
return (
<Image
{...commonImageProps}
src={iconImageUrl(providerWithoutPrefix)}
/>
);
}

return enterpriseConnection?.logoPublicUrl ? (
<Image
{...commonImageProps}
Expand Down

0 comments on commit 99f7536

Please # to comment.