make that login & register work
This commit is contained in:
@@ -258,5 +258,7 @@
|
|||||||
"Go to home": "Baş sahypa git",
|
"Go to home": "Baş sahypa git",
|
||||||
"Payment is successful": "Töleg geçdi",
|
"Payment is successful": "Töleg geçdi",
|
||||||
"Payment has failed": "Töleg geçmedi",
|
"Payment has failed": "Töleg geçmedi",
|
||||||
"Help": "Kömek"
|
"Help": "Kömek",
|
||||||
|
"Successfully logged in": "Üstünlik bilen girdiňiz",
|
||||||
|
"Please wait while we redirect you to your personal account": "Şahsy hasabyňyza geçýänçä garaşyň"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,9 @@ async function postData(url = '', data = {}) {
|
|||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
credentials: 'same-origin',
|
credentials: 'same-origin',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Accept': 'application/json',
|
||||||
'X-Requested-With': 'XMLHttpRequest'
|
'Content-Type': 'application/json',
|
||||||
|
'X-Requested-With': 'XMLHttpRequest'
|
||||||
},
|
},
|
||||||
referrerPolicy: 'no-referrer',
|
referrerPolicy: 'no-referrer',
|
||||||
body: JSON.stringify(data)
|
body: JSON.stringify(data)
|
||||||
|
|||||||
@@ -2,15 +2,27 @@
|
|||||||
|
|
||||||
@push('js')
|
@push('js')
|
||||||
<script>
|
<script>
|
||||||
async function login(event) {
|
async function login(event) {
|
||||||
const response = await postData(event.target.action, getFormData(event))
|
const response = await postData(event.target.action, getFormData(event))
|
||||||
|
|
||||||
if (response.errors) {
|
if (response.errors) {
|
||||||
loopObject(response.errors, item => addValidationClasses(item))
|
loopObject(response.errors, item => addValidationClasses(item))
|
||||||
} else {
|
|
||||||
removeValidationClasess()
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
removeValidationClasess()
|
||||||
|
|
||||||
|
await Swal.fire({
|
||||||
|
title: '{{ __('Successfully logged in') }}',
|
||||||
|
text: '{{ __('Please wait while we redirect you to your personal account') }}',
|
||||||
|
icon: 'success',
|
||||||
|
showDenyButton: false,
|
||||||
|
showCancelButton: false,
|
||||||
|
})
|
||||||
|
|
||||||
|
window.location.href = '{{ route('login') }}'
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
|
|||||||
@@ -2,16 +2,27 @@
|
|||||||
|
|
||||||
@push('js')
|
@push('js')
|
||||||
<script>
|
<script>
|
||||||
async function register(event) {
|
async function register(event) {
|
||||||
const response = await postData(event.target.action, getFormData(event))
|
const response = await postData(event.target.action, getFormData(event))
|
||||||
console.log(response)
|
|
||||||
|
|
||||||
if (response.errors) {
|
if (response.errors) {
|
||||||
loopObject(response.errors, item => addValidationClasses(item))
|
loopObject(response.errors, item => addValidationClasses(item))
|
||||||
} else {
|
|
||||||
removeValidationClasess()
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
removeValidationClasess()
|
||||||
|
|
||||||
|
await Swal.fire({
|
||||||
|
title: '{{ __('Successfully logged in') }}',
|
||||||
|
text: '{{ __('Please wait while we redirect you to your personal account') }}',
|
||||||
|
icon: 'success',
|
||||||
|
showDenyButton: false,
|
||||||
|
showCancelButton: false,
|
||||||
|
})
|
||||||
|
|
||||||
|
window.location.href = '{{ route('login') }}'
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user