9df4867fca
* WIP License server * WIP * Moves locations to App Store and Core * LocationType fixes * Runs db migrations post-deploy * WIP * WIP * Cleanup * WIP * WIP * Decouples translations from NavTabs * Adds admin submodule * Adds admin submodule * Sync dependencies * WIP * WIP * Updates submodules * Renames package * Updates submodules * Adds scripts for console * Updates license checker URL * Updates admin * Adds staging/prod admin console links * Update yarn.lock * Update NavTabs.tsx * WIP * Update admin * WIP * Adds hint to InputField * Update admin * Adds turbo admin dependecies * Update admin * Prevents redirection on form submit * Form warning fixes * Update admin * Form fixes * Update yarn.lock * Update admin * Update admin * Update admin * Adds withLicenseRequired HOC * Adds LicenseRequired to EE components * Admin deploy fix? * Updates submodules * Use relative inside lib * type fixes * Fixes turbo race condition * Relocates admin to console * Relocates admin to console * Update console * Update api * Update turbo.json * Update ErrorBoundary.tsx * Update defaultEvents.ts * Update checkLicense.ts * Update yarn.lock * Skip on E2E Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
51 lines
1.9 KiB
TypeScript
51 lines
1.9 KiB
TypeScript
import { IdentityProvider } from "@prisma/client";
|
|
import React from "react";
|
|
|
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
|
import ApiKeyListContainer from "@ee/components/apiKeys/ApiKeyListContainer";
|
|
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 />
|
|
<ApiKeyListContainer />
|
|
<TwoFactorAuthSection twoFactorEnabled={user?.twoFactorEnabled || false} />
|
|
<DisableUserImpersonation disableImpersonation={user?.disableImpersonation ?? true} />
|
|
</div>
|
|
)}
|
|
|
|
<SAMLConfiguration teamsView={false} teamId={null} />
|
|
</>
|
|
</SettingsShell>
|
|
);
|
|
}
|