show 2fa secret as text also (example: adding to bitwarden)
This commit is contained in:
@@ -265,11 +265,13 @@ function FactorQrCode({
|
|||||||
z.object({
|
z.object({
|
||||||
factorName: z.string().min(1),
|
factorName: z.string().min(1),
|
||||||
qrCode: z.string().min(1),
|
qrCode: z.string().min(1),
|
||||||
|
totpSecret: z.string().min(1),
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
factorName: '',
|
factorName: '',
|
||||||
qrCode: '',
|
qrCode: '',
|
||||||
|
totpSecret: '',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -319,6 +321,7 @@ function FactorQrCode({
|
|||||||
if (data.type === 'totp') {
|
if (data.type === 'totp') {
|
||||||
form.setValue('factorName', name);
|
form.setValue('factorName', name);
|
||||||
form.setValue('qrCode', data.totp.qr_code);
|
form.setValue('qrCode', data.totp.qr_code);
|
||||||
|
form.setValue('totpSecret', data.totp.secret);
|
||||||
}
|
}
|
||||||
|
|
||||||
// dispatch event to set factor ID
|
// dispatch event to set factor ID
|
||||||
@@ -343,6 +346,10 @@ function FactorQrCode({
|
|||||||
<div className={'flex justify-center'}>
|
<div className={'flex justify-center'}>
|
||||||
<QrImage src={form.getValues('qrCode')} />
|
<QrImage src={form.getValues('qrCode')} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<p className='text-center text-sm'>
|
||||||
|
{form.getValues('totpSecret')}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user