ajax request login blade

This commit is contained in:
Resul Madesenow
2024-02-24 14:47:08 +05:00
parent 14cc231372
commit a6ad59c1f8
3 changed files with 87 additions and 52 deletions

View File

@@ -1,5 +1,49 @@
@extends('vendor.nova.partials.auth-layout')
@push('js')
<script>
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') }}'
}
}
}
</script>
@endpush
@section('content')
<div class="login-section d-center items-center h-screen">
<div class="d-none h-full max-w-4xl">