2021-09-21 09:29:20 +00:00
|
|
|
import React from "react";
|
2021-09-22 19:52:38 +00:00
|
|
|
|
2021-10-08 11:43:48 +00:00
|
|
|
import { useLocale } from "@lib/hooks/useLocale";
|
2021-10-14 10:57:49 +00:00
|
|
|
import { trpc } from "@lib/trpc";
|
2021-09-22 19:52:38 +00:00
|
|
|
|
2021-09-29 21:33:18 +00:00
|
|
|
import SettingsShell from "@components/SettingsShell";
|
2021-09-22 19:52:38 +00:00
|
|
|
import Shell from "@components/Shell";
|
2021-09-21 09:29:20 +00:00
|
|
|
import ChangePasswordSection from "@components/security/ChangePasswordSection";
|
2021-09-22 19:52:38 +00:00
|
|
|
import TwoFactorAuthSection from "@components/security/TwoFactorAuthSection";
|
2021-09-21 09:29:20 +00:00
|
|
|
|
2021-10-14 10:57:49 +00:00
|
|
|
export default function Security() {
|
|
|
|
const user = trpc.useQuery(["viewer.me"]).data;
|
2021-10-12 13:11:33 +00:00
|
|
|
const { t } = useLocale();
|
2021-09-21 09:29:20 +00:00
|
|
|
return (
|
2021-10-08 11:43:48 +00:00
|
|
|
<Shell heading={t("security")} subtitle={t("manage_account_security")}>
|
2021-09-21 09:29:20 +00:00
|
|
|
<SettingsShell>
|
2021-10-12 13:11:33 +00:00
|
|
|
<ChangePasswordSection />
|
2021-10-20 15:42:40 +00:00
|
|
|
<TwoFactorAuthSection twoFactorEnabled={user?.twoFactorEnabled || false} />
|
2021-09-21 09:29:20 +00:00
|
|
|
</SettingsShell>
|
|
|
|
</Shell>
|
|
|
|
);
|
|
|
|
}
|