diff --git a/apps/web/src/app/(dashboard)/settings/security/page.tsx b/apps/web/src/app/(dashboard)/settings/security/page.tsx index 9e99b73e8..ae97e7fb5 100644 --- a/apps/web/src/app/(dashboard)/settings/security/page.tsx +++ b/apps/web/src/app/(dashboard)/settings/security/page.tsx @@ -1,3 +1,4 @@ +import { IDENTITY_PROVIDER_NAME } from '@documenso/lib/constants/auth'; import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session'; import { AuthenticatorApp } from '~/components/forms/2fa/authenticator-app'; @@ -17,28 +18,43 @@ export default async function SecuritySettingsPage() {
- + {user.identityProvider === 'DOCUMENSO' ? ( +
+ -
+
-

Two Factor Authentication

+

Two Factor Authentication

-

- Add and manage your two factor security settings to add an extra layer of security to your - account! -

+

+ Add and manage your two factor security settings to add an extra layer of security to + your account! +

-
-
Two-factor methods
+
+
Two-factor methods
- -
+ +
- {user.twoFactorEnabled && ( -
-
Recovery methods
+ {user.twoFactorEnabled && ( +
+
Recovery methods
- + +
+ )} +
+ ) : ( +
+

+ Your account is managed by {IDENTITY_PROVIDER_NAME[user.identityProvider]} +

+

+ To update your password, enable two-factor authentication, and manage other security + settings, please go to your {IDENTITY_PROVIDER_NAME[user.identityProvider]} account + settings. +

)}
diff --git a/packages/lib/constants/auth.ts b/packages/lib/constants/auth.ts index 9a9652b95..837ca3e3a 100644 --- a/packages/lib/constants/auth.ts +++ b/packages/lib/constants/auth.ts @@ -1,5 +1,12 @@ +import { IdentityProvider } from '@documenso/prisma/client'; + export const SALT_ROUNDS = 12; +export const IDENTITY_PROVIDER_NAME: { [key in IdentityProvider]: string } = { + [IdentityProvider.DOCUMENSO]: 'Documenso', + [IdentityProvider.GOOGLE]: 'Google', +}; + export const IS_GOOGLE_SSO_ENABLED = Boolean( process.env.NEXT_PRIVATE_GOOGLE_CLIENT_ID && process.env.NEXT_PRIVATE_GOOGLE_CLIENT_SECRET, );