Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(clerk-js): Fix broken enterprise connection icon for custom SAML provider #4809

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
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
Loading