* First round of changes * Some missing styling * Last round of core changes * Color tweaks * Improving code readability * Reverting unneeded changes * Reverting yarn.lock * Removing yarn.lock * Empty state updated * Fixing webhook test * Cleaning up code * Fixing test and simplifying code a bit * Merging API Keys into developer section * Unifying Empty Screen with monorepo version * Cleaning up * Installed apps logic consistency + cleaning up * Type fixes * Apply suggestions from code review Co-authored-by: Omar López <zomars@me.com> Co-authored-by: alannnc <alannnc@gmail.com> * Improvements, still WIP * Update apps/web/pages/apps/installed.tsx Co-authored-by: Omar López <zomars@me.com> * Apply suggestions from code review Co-authored-by: Omar López <zomars@me.com> * App active install status * Apple Calendar setup, Daily.co preinstalled * Final pass * Minor tweaks * Conflicts with migration ignored * Fixing merge * Fixing merge yet again * Adopting main changes * Removing unneeded data-testid * Fixing reported bugs * Simplifying webhook query * Moving teams settings tab to second Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: zomars <zomars@me.com> Co-authored-by: alannnc <alannnc@gmail.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
49 lines
1.8 KiB
TypeScript
49 lines
1.8 KiB
TypeScript
import { IdentityProvider } from "@prisma/client";
|
|
import React from "react";
|
|
|
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
|
import SAMLConfiguration from "@ee/components/saml/Configuration";
|
|
|
|
import { identityProviderNameMap } from "@lib/auth";
|
|
import { trpc } from "@lib/trpc";
|
|
|
|
import SettingsShell from "@components/SettingsShell";
|
|
import ChangePasswordSection from "@components/security/ChangePasswordSection";
|
|
import DisableUserImpersonation from "@components/security/DisableUserImpersonation";
|
|
import TwoFactorAuthSection from "@components/security/TwoFactorAuthSection";
|
|
|
|
export default function Security() {
|
|
const user = trpc.useQuery(["viewer.me"]).data;
|
|
const { t } = useLocale();
|
|
return (
|
|
<SettingsShell heading={t("security")} subtitle={t("manage_account_security")}>
|
|
<>
|
|
{user && user.identityProvider !== IdentityProvider.CAL ? (
|
|
<>
|
|
<div className="mt-6">
|
|
<h2 className="font-cal text-lg font-medium leading-6 text-gray-900">
|
|
{t("account_managed_by_identity_provider", {
|
|
provider: identityProviderNameMap[user.identityProvider],
|
|
})}
|
|
</h2>
|
|
</div>
|
|
<p className="mt-1 text-sm text-gray-500">
|
|
{t("account_managed_by_identity_provider_description", {
|
|
provider: identityProviderNameMap[user.identityProvider],
|
|
})}
|
|
</p>
|
|
</>
|
|
) : (
|
|
<div className="space-y-2 divide-y">
|
|
<ChangePasswordSection />
|
|
<TwoFactorAuthSection twoFactorEnabled={user?.twoFactorEnabled || false} />
|
|
<DisableUserImpersonation disableImpersonation={user?.disableImpersonation ?? true} />
|
|
</div>
|
|
)}
|
|
|
|
<SAMLConfiguration teamsView={false} teamId={null} />
|
|
</>
|
|
</SettingsShell>
|
|
);
|
|
}
|