Files
sign/packages/lib/server-only/2fa/is-2fa-availble.ts

14 lines
371 B
TypeScript
Raw Normal View History

2025-01-02 15:33:37 +11:00
import type { User } from '@prisma/client';
import { DOCUMENSO_ENCRYPTION_KEY } from '../../constants/crypto';
type IsTwoFactorAuthenticationEnabledOptions = {
user: User;
};
export const isTwoFactorAuthenticationEnabled = ({
user,
}: IsTwoFactorAuthenticationEnabledOptions) => {
return user.twoFactorEnabled && typeof DOCUMENSO_ENCRYPTION_KEY === 'string';
};