2024-04-03 15:18:36 +08:00
|
|
|
import type { User } from '@documenso/prisma/client';
|
2023-12-01 05:52:16 +05:30
|
|
|
|
|
|
|
|
import { DOCUMENSO_ENCRYPTION_KEY } from '../../constants/crypto';
|
|
|
|
|
|
|
|
|
|
type IsTwoFactorAuthenticationEnabledOptions = {
|
|
|
|
|
user: User;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const isTwoFactorAuthenticationEnabled = ({
|
|
|
|
|
user,
|
|
|
|
|
}: IsTwoFactorAuthenticationEnabledOptions) => {
|
2024-04-03 15:18:36 +08:00
|
|
|
return user.twoFactorEnabled && typeof DOCUMENSO_ENCRYPTION_KEY === 'string';
|
2023-12-01 05:52:16 +05:30
|
|
|
};
|