diff --git a/resources/views/modules/management/user/index.blade.php b/resources/views/modules/management/user/index.blade.php index 90dcd3a..f670842 100644 --- a/resources/views/modules/management/user/index.blade.php +++ b/resources/views/modules/management/user/index.blade.php @@ -92,12 +92,17 @@ $("#grid-data").on("click", ".forcelogin", function() { // Callback handler that will be called on success request.done(function(response, textStatus, jqXHR){ console.log(response); - toastr.success("Berhasil Login", 'Berhasil!', {positionClass: 'toast-bottom-right', containerId: 'toast-bottom-right'}); - //window.location.href = '{{url("/dashboard")}}'; - history.pushState(null, null, location.href); - window.onpopstate = function () { - history.go(1); - }; + if(response.status == true){ + toastr.success("Berhasil Login", 'Berhasil!', {positionClass: 'toast-bottom-right', containerId: 'toast-bottom-right'}); + window.location.href = '{{url("/dashboard")}}'; + history.pushState(null, null, location.href); + window.onpopstate = function () { + history.go(1); + }; + }else{ + toastr.error("Maaf Terjadi Kesalahan", 'Gagal!', {positionClass: 'toast-bottom-right', containerId: 'toast-bottom-right'}); + } + }); // Callback handler that will be called on failure