mirror of
https://github.com/hanzoai/sign.git
synced 2026-10-21 01:21:51 +00:00
14 lines
361 B
TypeScript
14 lines
361 B
TypeScript
import type { User } from '@prisma/client';
|
|
|
|
import { SIGN_ENCRYPTION_KEY } from '../../constants/crypto';
|
|
|
|
type IsTwoFactorAuthenticationEnabledOptions = {
|
|
user: User;
|
|
};
|
|
|
|
export const isTwoFactorAuthenticationEnabled = ({
|
|
user,
|
|
}: IsTwoFactorAuthenticationEnabledOptions) => {
|
|
return user.twoFactorEnabled && typeof SIGN_ENCRYPTION_KEY === 'string';
|
|
};
|