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