Commit 698c7fa3 by Triyah Fatmawati

Fix Captcha

parent 50750dcf
......@@ -219,6 +219,6 @@ class LoginController extends Controller
}
public function reloadCaptcha()
{
return response()->json('captcha', captcha_img());
return response()->json(['captcha'=> captcha_img()]);
}
}
......@@ -96,15 +96,16 @@
@push('scripts')
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
$('.reload').click(function () {
console.log('tes');
$.ajax({
type: 'GET',
url: 'reload-captcha',
success: function (data) {
$(".captcha span").html(data.captcha);
}
});
});
$(document).ready(function(){
$('#reload').click(function(){
$.ajax({
type: 'GET',
url: 'reload-captcha',
success: function (data) {
$(".captcha span").html(data.captcha);
}
});
})
})
</script>
@endpush
\ No newline at end of file
......@@ -18,6 +18,7 @@
<!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
@stack('scripts')
</head>
<body>
<div id="app">
......@@ -75,7 +76,6 @@
<main class="py-4">
@yield('content')
</main>
</div>
@stack('scripts')
</div>
</body>
</html>
......@@ -15,7 +15,7 @@ Auth::routes(['register' => false]);
// use Illuminate\Routing\Route;
Route::get('reload-captcha', 'Auth\LoginController@reloadCaptcha')->name('reload-captcha');
Route::get('reload-captcha', 'Auth\LoginController@reloadCaptcha')->name('reload-captch');
// Route::get('login','Auth\LoginController@showLoginForm')->name('login');
// Route::post('login','Auth\LoginController@login');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment