* feat: integrate SNJS MFA with web * fix: create rudimentary typings file for qrcode.react * chore: lint fixes * fix: address PR feedback * fix: address PR feedback * fix: address PR feedback 2 * fix: replace spread props on TwoFactorAuthWrapper component * chore: change null check to undefined check
14 lines
454 B
TypeScript
14 lines
454 B
TypeScript
import { FunctionComponent } from 'preact';
|
|
import { useState } from 'preact/hooks';
|
|
import { MfaProps } from './MfaProps';
|
|
import { TwoFactorAuth } from './TwoFactorAuth';
|
|
import { TwoFactorAuthView } from './TwoFactorAuthView';
|
|
|
|
export const TwoFactorAuthWrapper: FunctionComponent<MfaProps> = ({
|
|
mfaGateway,
|
|
}) => {
|
|
const [auth] = useState(() => new TwoFactorAuth(mfaGateway));
|
|
auth.fetchStatus();
|
|
return <TwoFactorAuthView auth={auth} />;
|
|
};
|