Merge pull request #2164 from pterodactyl/fix/2163

Fix 2FA codes missing prepended 0s
This commit is contained in:
Dane Everitt 2020-07-11 17:18:24 -07:00 committed by GitHub
commit 45a85938df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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();
loginCheckpoint(location.state?.token || '', code, recoveryCode) loginCheckpoint(location.state?.token || '', code, recoveryCode)
.then(response => { .then(response => {
if (response.complete) { if (response.complete) {