Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/frontend/account/account-preferences-security.tsx
2209 views
1
/*
2
* This file is part of CoCalc: Copyright © 2025 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { useTypedRedux } from "@cocalc/frontend/app-framework";
7
8
import { KUCALC_COCALC_COM } from "@cocalc/util/db-schema/site-defaults";
9
import ApiKeys from "./settings/api-keys";
10
import GlobalSSHKeys from "./ssh-keys/global-ssh-keys";
11
12
import type { IconName } from "@cocalc/frontend/components/icon";
13
14
// Icon constant for account preferences section
15
export const KEYS_ICON_NAME: IconName = "key";
16
17
export function AccountPreferencesSecurity() {
18
const is_anonymous = useTypedRedux("account", "is_anonymous");
19
const kucalc = useTypedRedux("customize", "kucalc");
20
const ssh_gateway = useTypedRedux("customize", "ssh_gateway");
21
22
return (
23
<>
24
{(ssh_gateway || kucalc === KUCALC_COCALC_COM) && <GlobalSSHKeys />}
25
{!is_anonymous && <ApiKeys />}
26
</>
27
);
28
}
29
30