Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

azure ad → entra id

Steven Tey1185e10025b4
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/security/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/security/page-client.tsx
index 1a18ed5723..532d0ce08c 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/security/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/security/page-client.tsx
@@ -28,6 +28,11 @@ const SAMLSection = () => {
const { RemoveSAMLModal, setShowRemoveSAMLModal } = useRemoveSAMLModal();
const { provider, configured, loading } = useSAML();
+ const currentProvider = useMemo(
+ () => SAML_PROVIDERS.find((p) => p.name.startsWith(provider!)),
+ [provider],
+ );
+
const data = useMemo(() => {
if (loading) {
return {
@@ -39,12 +44,12 @@ const SAMLSection = () => {
return {
logo: (
<img
- src={SAML_PROVIDERS.find((p) => p.name === provider)!.logo}
- alt={provider + " logo"}
+ src={currentProvider!.logo}
+ alt={currentProvider!.name}
className="h-8 w-8"
/>
),
- title: `${provider} SAML`,
+ title: `${currentProvider!.name} SAML`,
description: "SAML SSO is configured for your workspace.",
};
} else
diff --git a/apps/web/lib/swr/use-saml.ts b/apps/web/lib/swr/use-saml.ts
index d64faffa0f..eb6615de77 100644
--- a/apps/web/lib/swr/use-saml.ts
+++ b/apps/web/lib/swr/use-saml.ts
@@ -5,10 +5,10 @@ import useSWR from "swr";
import useWorkspace from "./use-workspace";
export default function useSAML() {
- const { id } = useWorkspace();
+ const { id: workspaceId } = useWorkspace();
const { data, isLoading, mutate } = useSWR<{ connections: SAMLSSORecord[] }>(
- id && `/api/workspaces/${id}/saml`,
+ workspaceId && `/api/workspaces/${workspaceId}/saml`,
fetcher,
{
keepPreviousData: true,
diff --git a/apps/web/ui/modals/remove-saml-modal.tsx b/apps/web/ui/modals/remove-saml-modal.tsx
index 163800a658..b76ded6f13 100644
--- a/apps/web/ui/modals/remove-saml-modal.tsx
+++ b/apps/web/ui/modals/remove-saml-modal.tsx
@@ -21,6 +21,10 @@ function RemoveSAMLModal({
const [removing, setRemoving] = useState(false);
const { id, logo } = useWorkspace();
const { saml, provider, mutate } = useSAML();
+ const currentProvider = useMemo(
+ () => SAML_PROVIDERS.find((p) => p.name.startsWith(provider!)),
+ [provider],
+ );
return (
<Modal
@@ -49,14 +53,16 @@ function RemoveSAMLModal({
<div className="flex flex-col space-y-4 bg-neutral-50 px-4 py-8 text-left sm:px-16">
<div className="flex items-center space-x-3 rounded-md border border-neutral-300 bg-white p-3">
<img
- src={SAML_PROVIDERS.find((p) => p.name === provider)!.logo}
- alt={provider + " logo"}
+ src={currentProvider!.logo}
+ alt={currentProvider!.name}
className="h-8 w-8"
/>
<div className="flex flex-col">
- <h3 className="text-sm font-medium">{provider} SAML</h3>
+ <h3 className="text-sm font-medium">
+ {currentProvider!.name} SAML
+ </h3>
<p className="text-xs text-neutral-500">
- {provider} SAML is configured
+ {currentProvider!.name} SAML is configured for your workspace.
</p>
</div>
</div>
diff --git a/packages/utils/src/constants/saml.ts b/packages/utils/src/constants/saml.ts
index 5c1c6ec0ab..a4d3c8faf1 100644
--- a/packages/utils/src/constants/saml.ts
+++ b/packages/utils/src/constants/saml.ts
@@ -12,7 +12,7 @@ export const SAML_PROVIDERS = [
wip: false,
},
{
- name: "Azure AD",
+ name: "Entra ID (formerly Azure AD)",
logo: "https://assets.dub.co/misc/icons/azure.svg",
saml: "azure",
samlModalCopy: "App Federation Metadata URL",