|
|
|
|
@ -91,7 +91,7 @@
|
|
|
|
|
gacode: fieldValue('gacode')
|
|
|
|
|
}).then(function (data) {
|
|
|
|
|
if (data.ret == 1) {
|
|
|
|
|
VenixAuth.showMessage(loginForm, 'success', data.msg || VenixUserCopy.text('auth.login.welcome'));
|
|
|
|
|
VenixAuth.showMessage(loginForm, 'success', VenixUserCopy.text('auth.login.welcome'));
|
|
|
|
|
window.setTimeout(function () {
|
|
|
|
|
window.location.href = '/user/';
|
|
|
|
|
}, 700);
|
|
|
|
|
@ -101,7 +101,10 @@
|
|
|
|
|
if (data.need_email_verify == 1) {
|
|
|
|
|
verifyBox.style.display = 'grid';
|
|
|
|
|
if (gaVerifyBox) gaVerifyBox.style.display = 'none';
|
|
|
|
|
VenixAuth.showMessage(loginForm, fieldValue('emailcode') ? 'error' : 'warning', data.msg);
|
|
|
|
|
VenixAuth.showMessage(loginForm, fieldValue('emailcode') ? 'error' : 'warning',
|
|
|
|
|
VenixUserCopy.text(fieldValue('emailcode')
|
|
|
|
|
? 'auth.login.error.email_code_invalid'
|
|
|
|
|
: 'auth.login.email_verification_required'));
|
|
|
|
|
done();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
@ -109,16 +112,19 @@
|
|
|
|
|
if (data.need_ga_verify == 1) {
|
|
|
|
|
if (verifyBox) verifyBox.style.display = 'none';
|
|
|
|
|
if (gaVerifyBox) gaVerifyBox.style.display = 'grid';
|
|
|
|
|
VenixAuth.showMessage(loginForm, fieldValue('gacode') ? 'error' : 'warning', data.msg);
|
|
|
|
|
VenixAuth.showMessage(loginForm, fieldValue('gacode') ? 'error' : 'warning',
|
|
|
|
|
VenixUserCopy.text(fieldValue('gacode')
|
|
|
|
|
? 'auth.login.error.authenticator_invalid'
|
|
|
|
|
: 'auth.login.authenticator_required'));
|
|
|
|
|
done();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
VenixAuth.showMessage(loginForm, 'error', data.msg);
|
|
|
|
|
VenixAuth.showMessage(loginForm, 'error', VenixUserCopy.text('auth.message.request_failed'));
|
|
|
|
|
VenixAuth.refreshCaptcha();
|
|
|
|
|
done();
|
|
|
|
|
}).catch(function (error) {
|
|
|
|
|
VenixAuth.showMessage(loginForm, 'error', error.message);
|
|
|
|
|
VenixAuth.showMessage(loginForm, 'error', VenixAuth.errorMessage(error));
|
|
|
|
|
done();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
@ -133,19 +139,24 @@
|
|
|
|
|
if (data.need_ga_verify == 1) {
|
|
|
|
|
if (verifyBox) verifyBox.style.display = 'none';
|
|
|
|
|
if (gaVerifyBox) gaVerifyBox.style.display = 'grid';
|
|
|
|
|
VenixAuth.showMessage(loginForm, 'warning', data.msg);
|
|
|
|
|
VenixAuth.showMessage(loginForm, 'warning', VenixUserCopy.text('auth.login.authenticator_required'));
|
|
|
|
|
done();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
VenixAuth.showMessage(loginForm, data.ret == 1 ? 'success' : 'error', data.msg);
|
|
|
|
|
VenixAuth.showMessage(loginForm, data.ret == 1 ? 'success' : 'error',
|
|
|
|
|
VenixUserCopy.text(data.ret == 1
|
|
|
|
|
? 'auth.login.verify.sent'
|
|
|
|
|
: (data.retry_after > 0
|
|
|
|
|
? 'auth.login.verify.retry_later'
|
|
|
|
|
: 'auth.login.verify.send_failed')));
|
|
|
|
|
if (data.ret == 1 || data.retry_after > 0) {
|
|
|
|
|
VenixAuth.countdown(verifyButton, data.retry_after > 0 ? data.retry_after : 60, sendLoginVerifyText);
|
|
|
|
|
} else {
|
|
|
|
|
done();
|
|
|
|
|
}
|
|
|
|
|
}).catch(function (error) {
|
|
|
|
|
VenixAuth.showMessage(loginForm, 'error', error.message);
|
|
|
|
|
VenixAuth.showMessage(loginForm, 'error', VenixAuth.errorMessage(error));
|
|
|
|
|
done();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|