Fix 2FA codes missing prepended 0s

This commit is contained in:
Matthew Penner 2020-07-11 13:07:54 -06:00
parent 6188b9287c
commit 55a3e76d99

View file

@ -40,7 +40,7 @@ const LoginCheckpointContainer = () => {
? 'Enter one of the recovery codes generated when you setup 2-Factor authentication on this account in order to continue.' ? 'Enter one of the recovery codes generated when you setup 2-Factor authentication on this account in order to continue.'
: 'Enter the two-factor token generated by your device.' : 'Enter the two-factor token generated by your device.'
} }
type={isMissingDevice ? 'text' : 'number'} type={'text'}
autoFocus autoFocus
/> />
</div> </div>
@ -81,6 +81,7 @@ const LoginCheckpointContainer = () => {
const EnhancedForm = withFormik<Props, Values>({ const EnhancedForm = withFormik<Props, Values>({
handleSubmit: ({ code, recoveryCode }, { setSubmitting, props: { addError, clearFlashes, location } }) => { handleSubmit: ({ code, recoveryCode }, { setSubmitting, props: { addError, clearFlashes, location } }) => {
clearFlashes(); clearFlashes();
console.log(code);
loginCheckpoint(location.state?.token || '', code, recoveryCode) loginCheckpoint(location.state?.token || '', code, recoveryCode)
.then(response => { .then(response => {
if (response.complete) { if (response.complete) {