ajax request login blade
This commit is contained in:
@@ -46,48 +46,14 @@
|
||||
<script src="/assets/js/sweetalert2@11.js"></script>
|
||||
<script src="/assets/js/fn.js"></script>
|
||||
<script>
|
||||
new Inputmask("+(\\9\\93)-99-99-99-99").mask(document.getElementById('phone'));
|
||||
const phone = document.getElementById('phone');
|
||||
|
||||
async function resetPassword(event) {
|
||||
const response = await postData(event.target.action, getFormData(event))
|
||||
|
||||
if (response.errors) {
|
||||
loopObject(response.errors, item => addValidationClasses(item))
|
||||
} else {
|
||||
removeValidationClasess()
|
||||
|
||||
if (response.step === 1) {
|
||||
showVerificationCodeBox()
|
||||
|
||||
Swal.fire({
|
||||
title: '{{ __('Verification code') }}',
|
||||
text: response.message,
|
||||
icon: 'info'
|
||||
})
|
||||
}
|
||||
|
||||
if (response.step === 2) {
|
||||
showPasswordBox()
|
||||
|
||||
Swal.fire({
|
||||
title: '{{ __('Reset Password') }}',
|
||||
text: response.message,
|
||||
icon: 'warning'
|
||||
})
|
||||
}
|
||||
|
||||
if (response.step === 3) {
|
||||
await Swal.fire({
|
||||
title: response.message,
|
||||
showDenyButton: false,
|
||||
showCancelButton: false,
|
||||
})
|
||||
|
||||
window.location.href = '{{ route('login') }}'
|
||||
}
|
||||
if (phone) {
|
||||
new Inputmask("+(\\9\\93)-99-99-99-99").mask(document.getElementById('phone'));
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@stack('js')
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user