fix logout

This commit is contained in:
daengdeni 2024-02-01 11:31:06 +07:00
parent 0e251f2fa7
commit 841837f541
8 changed files with 164 additions and 116 deletions

View File

@ -26,14 +26,6 @@ class BootstrapDefault
{ {
# Include global vendors # Include global vendors
addVendors(['datatables']); addVendors(['datatables']);
# Include global javascript files
addJavascriptFile('assets/js/custom/widgets.js');
addJavascriptFile('assets/js/custom/apps/chat/chat.js');
addJavascriptFile('assets/js/custom/utilities/modals/upgrade-plan.js');
addJavascriptFile('assets/js/custom/utilities/modals/create-app.js');
addJavascriptFile('assets/js/custom/utilities/modals/users-search.js');
addJavascriptFile('assets/js/custom/utilities/modals/new-target.js');
} }
public function initDarkSidebarLayout() public function initDarkSidebarLayout()

View File

@ -60,28 +60,28 @@ return [
'KT_THEME_VENDORS' => [ 'KT_THEME_VENDORS' => [
'datatables' => [ 'datatables' => [
'css' => [ 'css' => [
'assets/plugins/custom/datatables/datatables.bundle.css', 'assets/resources/mix/vendors/datatables/datatables.bundle.css',
], ],
'js' => [ 'js' => [
'assets/plugins/custom/datatables/datatables.bundle.js', 'assets/resources/mix/vendors/datatables/datatables.bundle.js',
], ],
], ],
'formrepeater' => [ 'formrepeater' => [
'js' => [ 'js' => [
'assets/plugins/custom/formrepeater/formrepeater.bundle.js', 'assets/resources/mix/vendors/formrepeater/formrepeater.bundle.js',
], ],
], ],
'fullcalendar' => [ 'fullcalendar' => [
'css' => [ 'css' => [
'assets/plugins/custom/fullcalendar/fullcalendar.bundle.css', 'assets/resources/mix/vendors/fullcalendar/fullcalendar.bundle.css',
], ],
'js' => [ 'js' => [
'assets/plugins/custom/fullcalendar/fullcalendar.bundle.js', 'assets/resources/mix/vendors/fullcalendar/fullcalendar.bundle.js',
], ],
], ],
'flotcharts' => [ 'flotcharts' => [
'js' => [ 'js' => [
'assets/plugins/custom/flotcharts/flotcharts.bundle.js', 'assets/resources/mix/vendors/flotcharts/flotcharts.bundle.js',
], ],
], ],
'google-jsapi' => [ 'google-jsapi' => [
@ -91,79 +91,79 @@ return [
], ],
'tinymce' => [ 'tinymce' => [
'js' => [ 'js' => [
'assets/plugins/custom/tinymce/tinymce.bundle.js', 'assets/resources/mix/vendors/tinymce/tinymce.bundle.js',
], ],
], ],
'ckeditor-classic' => [ 'ckeditor-classic' => [
'js' => [ 'js' => [
'assets/plugins/custom/ckeditor/ckeditor-classic.bundle.js', 'assets/resources/mix/vendors/ckeditor/ckeditor-classic.bundle.js',
], ],
], ],
'ckeditor-inline' => [ 'ckeditor-inline' => [
'js' => [ 'js' => [
'assets/plugins/custom/ckeditor/ckeditor-inline.bundle.js', 'assets/resources/mix/vendors/ckeditor/ckeditor-inline.bundle.js',
], ],
], ],
'ckeditor-balloon' => [ 'ckeditor-balloon' => [
'js' => [ 'js' => [
'assets/plugins/custom/ckeditor/ckeditor-balloon.bundle.js', 'assets/resources/mix/vendors/ckeditor/ckeditor-balloon.bundle.js',
], ],
], ],
'ckeditor-balloon-block' => [ 'ckeditor-balloon-block' => [
'js' => [ 'js' => [
'assets/plugins/custom/ckeditor/ckeditor-balloon-block.bundle.js', 'assets/resources/mix/vendors/ckeditor/ckeditor-balloon-block.bundle.js',
], ],
], ],
'ckeditor-document' => [ 'ckeditor-document' => [
'js' => [ 'js' => [
'assets/plugins/custom/ckeditor/ckeditor-document.bundle.js', 'assets/resources/mix/vendors/ckeditor/ckeditor-document.bundle.js',
], ],
], ],
'draggable' => [ 'draggable' => [
'js' => [ 'js' => [
'assets/plugins/custom/draggable/draggable.bundle.js', 'assets/resources/mix/vendors/draggable/draggable.bundle.js',
], ],
], ],
'fslightbox' => [ 'fslightbox' => [
'js' => [ 'js' => [
'assets/plugins/custom/fslightbox/fslightbox.bundle.js', 'assets/resources/mix/vendors/fslightbox/fslightbox.bundle.js',
], ],
], ],
'jkanban' => [ 'jkanban' => [
'css' => [ 'css' => [
'assets/plugins/custom/jkanban/jkanban.bundle.css', 'assets/resources/mix/vendors/jkanban/jkanban.bundle.css',
], ],
'js' => [ 'js' => [
'assets/plugins/custom/jkanban/jkanban.bundle.js', 'assets/resources/mix/vendors/jkanban/jkanban.bundle.js',
], ],
], ],
'typedjs' => [ 'typedjs' => [
'js' => [ 'js' => [
'assets/plugins/custom/typedjs/typedjs.bundle.js', 'assets/resources/mix/vendors/typedjs/typedjs.bundle.js',
], ],
], ],
'cookiealert' => [ 'cookiealert' => [
'css' => [ 'css' => [
'assets/plugins/custom/cookiealert/cookiealert.bundle.css', 'assets/resources/mix/vendors/cookiealert/cookiealert.bundle.css',
], ],
'js' => [ 'js' => [
'assets/plugins/custom/cookiealert/cookiealert.bundle.js', 'assets/resources/mix/vendors/cookiealert/cookiealert.bundle.js',
], ],
], ],
'cropper' => [ 'cropper' => [
'css' => [ 'css' => [
'assets/plugins/custom/cropper/cropper.bundle.css', 'assets/resources/mix/vendors/cropper/cropper.bundle.css',
], ],
'js' => [ 'js' => [
'assets/plugins/custom/cropper/cropper.bundle.js', 'assets/resources/mix/vendors/cropper/cropper.bundle.js',
], ],
], ],
'vis-timeline' => [ 'vis-timeline' => [
'css' => [ 'css' => [
'assets/plugins/custom/vis-timeline/vis-timeline.bundle.css', 'assets/resources/mix/vendors/vis-timeline/vis-timeline.bundle.css',
], ],
'js' => [ 'js' => [
'assets/plugins/custom/vis-timeline/vis-timeline.bundle.js', 'assets/resources/mix/vendors/vis-timeline/vis-timeline.bundle.js',
], ],
], ],
'jstree' => [ 'jstree' => [
@ -176,18 +176,18 @@ return [
], ],
'prismjs' => [ 'prismjs' => [
'css' => [ 'css' => [
'assets/plugins/custom/prismjs/prismjs.bundle.css', 'assets/resources/mix/vendors/prismjs/prismjs.bundle.css',
], ],
'js' => [ 'js' => [
'assets/plugins/custom/prismjs/prismjs.bundle.js', 'assets/resources/mix/vendors/prismjs/prismjs.bundle.js',
], ],
], ],
'leaflet' => [ 'leaflet' => [
'css' => [ 'css' => [
'assets/plugins/custom/leaflet/leaflet.bundle.css', 'assets/resources/mix/vendors/leaflet/leaflet.bundle.css',
], ],
'js' => [ 'js' => [
'assets/plugins/custom/leaflet/leaflet.bundle.js', 'assets/resources/mix/vendors/leaflet/leaflet.bundle.js',
], ],
], ],
'amcharts' => [ 'amcharts' => [
@ -220,10 +220,10 @@ return [
], ],
'bootstrap-select' => [ 'bootstrap-select' => [
'css' => [ 'css' => [
'assets/plugins/custom/bootstrap-select/bootstrap-select.bundle.css', 'assets/resources/mix/vendors/bootstrap-select/bootstrap-select.bundle.css',
], ],
'js' => [ 'js' => [
'assets/plugins/custom/bootstrap-select/bootstrap-select.bundle.js', 'assets/resources/mix/vendors/bootstrap-select/bootstrap-select.bundle.js',
], ],
], ],
'chained-select' => [ 'chained-select' => [

View File

@ -1,5 +1,6 @@
{ {
"private": true, "private": true,
"version": "8.2.3",
"scripts": { "scripts": {
"dev": "npm run development", "dev": "npm run development",
"development": "mix", "development": "mix",
@ -10,105 +11,105 @@
"production": "mix --production" "production": "mix --production"
}, },
"dependencies": { "dependencies": {
"@ckeditor/ckeditor5-alignment": "^38.1.0", "@ckeditor/ckeditor5-alignment": "40.2.0",
"@ckeditor/ckeditor5-build-balloon": "^38.1.0", "@ckeditor/ckeditor5-build-balloon": "40.2.0",
"@ckeditor/ckeditor5-build-balloon-block": "^38.1.0", "@ckeditor/ckeditor5-build-balloon-block": "40.2.0",
"@ckeditor/ckeditor5-build-classic": "^38.1.0", "@ckeditor/ckeditor5-build-classic": "40.2.0",
"@ckeditor/ckeditor5-build-decoupled-document": "^38.1.0", "@ckeditor/ckeditor5-build-decoupled-document": "40.2.0",
"@ckeditor/ckeditor5-build-inline": "^38.1.0", "@ckeditor/ckeditor5-build-inline": "40.2.0",
"@eonasdan/tempus-dominus": "^6.7.7", "@eonasdan/tempus-dominus": "^6.9.4",
"@fortawesome/fontawesome-free": "^6.4.0", "@fortawesome/fontawesome-free": "^6.5.1",
"@popperjs/core": "2.11.8", "@popperjs/core": "2.11.8",
"@shopify/draggable": "^1.0.0-beta.12", "@shopify/draggable": "^1.1.3",
"@yaireo/tagify": "^4.17.8", "@yaireo/tagify": "^4.18.2",
"acorn": "^8.9.0", "acorn": "^8.11.3",
"apexcharts": "3.41.0", "apexcharts": "3.45.1",
"autosize": "^6.0.1", "autosize": "^6.0.1",
"axios": "^1.4.0", "axios": "^1.6.5",
"bootstrap": "5.3.0", "bootstrap": "5.3.2",
"bootstrap-cookie-alert": "^1.2.1", "bootstrap-cookie-alert": "^1.2.2",
"bootstrap-daterangepicker": "^3.1.0", "bootstrap-daterangepicker": "^3.1.0",
"bootstrap-icons": "^1.5.0", "bootstrap-icons": "^1.11.3",
"bootstrap-maxlength": "^1.10.1", "bootstrap-maxlength": "^1.10.1",
"bootstrap-multiselectsplitter": "^1.0.4", "bootstrap-multiselectsplitter": "^1.0.4",
"chalk": "^4.1.0", "chalk": "^5.3.0",
"chart.js": "^3.6.0", "chart.js": "^4.4.1",
"clipboard": "^2.0.8", "clipboard": "^2.0.11",
"countup.js": "^2.0.7", "countup.js": "^2.8.0",
"cropperjs": "^1.5.12", "cropperjs": "^1.6.1",
"datatables.net": "^1.13.4", "datatables.net": "^1.13.8",
"datatables.net-bs5": "^1.13.4", "datatables.net-bs5": "^1.13.8",
"datatables.net-buttons": "^2.3.6", "datatables.net-buttons": "^2.4.2",
"datatables.net-buttons-bs5": "^2.3.6", "datatables.net-buttons-bs5": "^2.4.2",
"datatables.net-colreorder": "^1.6.2", "datatables.net-colreorder": "^1.7.0",
"datatables.net-colreorder-bs5": "^1.6.2", "datatables.net-colreorder-bs5": "^1.7.0",
"datatables.net-datetime": "^1.4.1", "datatables.net-datetime": "^1.5.0",
"datatables.net-fixedcolumns": "^4.2.2", "datatables.net-fixedcolumns": "^4.3.0",
"datatables.net-fixedcolumns-bs5": "^4.2.2", "datatables.net-fixedcolumns-bs5": "^4.3.0",
"datatables.net-fixedheader": "^3.3.2", "datatables.net-fixedheader": "^3.4.0",
"datatables.net-fixedheader-bs5": "^3.3.2", "datatables.net-fixedheader-bs5": "^3.4.0",
"datatables.net-plugins": "^1.13.4", "datatables.net-plugins": "^1.13.6",
"datatables.net-responsive": "^2.4.1", "datatables.net-responsive": "^2.5.0",
"datatables.net-responsive-bs5": "^2.4.1", "datatables.net-responsive-bs5": "^2.5.0",
"datatables.net-rowgroup": "^1.3.1", "datatables.net-rowgroup": "^1.4.1",
"datatables.net-rowgroup-bs5": "^1.3.1", "datatables.net-rowgroup-bs5": "^1.4.1",
"datatables.net-rowreorder": "^1.3.3", "datatables.net-rowreorder": "^1.4.1",
"datatables.net-rowreorder-bs5": "^1.3.3", "datatables.net-rowreorder-bs5": "^1.4.1",
"datatables.net-scroller": "^2.1.1", "datatables.net-scroller": "^2.3.0",
"datatables.net-scroller-bs5": "^2.1.1", "datatables.net-scroller-bs5": "^2.3.0",
"datatables.net-select": "^1.6.2", "datatables.net-select": "^1.7.0",
"datatables.net-select-bs5": "^1.6.2", "datatables.net-select-bs5": "^1.7.0",
"dropzone": "^5.9.2", "dropzone": "^5.9.3",
"es6-promise": "^4.2.8", "es6-promise": "^4.2.8",
"es6-promise-polyfill": "^1.2.0", "es6-promise-polyfill": "^1.2.0",
"es6-shim": "^0.35.5", "es6-shim": "^0.35.8",
"esri-leaflet": "^3.0.2", "esri-leaflet": "^3.0.12",
"esri-leaflet-geocoder": "^3.0.0", "esri-leaflet-geocoder": "^3.1.4",
"flatpickr": "^4.6.9", "flatpickr": "^4.6.13",
"flot": "^4.2.2", "flot": "^4.2.6",
"fslightbox": "^3.3.0-2", "fs": "^0.0.1-security",
"fslightbox": "^3.4.1",
"fullcalendar": "^5.8.0", "fullcalendar": "^5.8.0",
"handlebars": "^4.7.7", "handlebars": "^4.7.8",
"inputmask": "^5.0.6", "inputmask": "^5.0.8",
"jkanban": "^1.3.1", "jkanban": "^1.3.1",
"jquery": "3.6.0", "jquery": "3.7.1",
"jquery-chained": "^2.0.0-beta.2",
"jquery.repeater": "^1.2.1", "jquery.repeater": "^1.2.1",
"jstree": "^3.3.11", "jstree": "^3.3.16",
"jszip": "^3.6.0", "jszip": "^3.10.1",
"leaflet": "^1.7.1", "leaflet": "^1.9.4",
"line-awesome": "^1.3.0", "line-awesome": "^1.3.0",
"lozad": "^1.16.0", "lozad": "^1.16.0",
"moment": "^2.29.1", "moment": "^2.30.1",
"nouislider": "^15.2.0", "nouislider": "^15.7.1",
"npm": "^7.19.1", "npm": "^10.3.0",
"pdfmake": "^0.2.0", "pdfmake": "^0.2.9",
"prism-themes": "^1.7.0", "prism-themes": "^1.9.0",
"prismjs": "^1.24.1", "prismjs": "^1.29.0",
"quill": "^1.3.7", "quill": "^1.3.7",
"select2": "^4.1.0-rc.0", "select2": "^4.1.0-rc.0",
"smooth-scroll": "^16.1.3", "smooth-scroll": "^16.1.3",
"sweetalert2": "11.4.8", "sweetalert2": "11.4.8",
"tiny-slider": "^2.9.3", "tiny-slider": "^2.9.4",
"tinymce": "^5.8.2", "tinymce": "^5.8.2",
"toastr": "^2.1.4", "toastr": "^2.1.4",
"typed.js": "2.0.16", "typed.js": "2.1.0",
"vis-timeline": "^7.4.9", "vis-timeline": "^7.7.3",
"wnumb": "^1.2.0" "wnumb": "^1.2.0"
}, },
"devDependencies": { "devDependencies": {
"alpinejs": "^3.7.1", "alpinejs": "^3.7.1",
"autoprefixer": "^10.4.2", "autoprefixer": "^10.4.2",
"del": "^6.0.0", "del": "^7.1.0",
"laravel-datatables-vite": "^0.5.2", "laravel-datatables-vite": "^0.5.2",
"laravel-mix": "^6.0.39", "laravel-mix": "^6.0.39",
"laravel-mix-purgecss": "^6.0.0", "laravel-mix-purgecss": "^6.0.0",
"lodash": "^4.17.19", "lodash": "^4.17.19",
"postcss": "^8.4.5", "postcss": "^8.4.33",
"postcss-import": "^14.0.2", "postcss-import": "^16.0.0",
"replace-in-file-webpack-plugin": "^1.0.6", "replace-in-file-webpack-plugin": "^1.0.6",
"resolve-url-loader": "^4.0.0", "resolve-url-loader": "^5.0.0",
"rtlcss": "^3.5.0", "rtlcss": "^4.1.1",
"sass": "1.55.0", "sass": "1.55.0",
"sass-loader": "13.2.0", "sass-loader": "13.2.0",
"webpack-rtl-plugin": "^2.0.0" "webpack-rtl-plugin": "^2.0.0"

View File

@ -0,0 +1,60 @@
"use strict";
var KTSigninGeneral = function () {
var t, e, r;
return {
init: function () {
t = document.querySelector("#kt_sign_in_form"), e = document.querySelector("#kt_sign_in_submit"), r = FormValidation.formValidation(t, {
fields: {
email: {
validators: {
notEmpty: {message: "User ID is required"}
}
}, password: {validators: {notEmpty: {message: "The password is required"}}}
},
plugins: {
trigger: new FormValidation.plugins.Trigger,
bootstrap: new FormValidation.plugins.Bootstrap5({
rowSelector: ".fv-row",
eleInvalidClass: "",
eleValidClass: ""
})
}
}), e.addEventListener("click", (function (i) {
i.preventDefault(), r.validate().then((function (r) {
"Valid" == r ? (e.setAttribute("data-kt-indicator", "on"), e.disabled = !0, axios.post(e.closest("form").getAttribute("action"), new FormData(t)).then((function (e) {
if (e) {
t.reset();
const e = t.getAttribute("data-kt-redirect-url");
e && (location.href = e)
} else Swal.fire({
text: "Sorry, the email or password is incorrect, please try again.",
icon: "error",
buttonsStyling: !1,
confirmButtonText: "Ok, got it!",
customClass: {confirmButton: "btn btn-primary"}
})
})).catch((function (t) {
Swal.fire({
text: "Sorry, looks like there are some errors detected, please try again.",
icon: "error",
buttonsStyling: !1,
confirmButtonText: "Ok, got it!",
customClass: {confirmButton: "btn btn-primary"}
})
})).then((() => {
e.removeAttribute("data-kt-indicator"), e.disabled = !1
}))) : Swal.fire({
text: "Sorry, looks like there are some errors detected, please try again.",
icon: "error",
buttonsStyling: !1,
confirmButtonText: "Ok, got it!",
customClass: {confirmButton: "btn btn-primary"}
})
}))
}))
}
}
}();
KTUtil.onDOMContentLoaded((function () {
KTSigninGeneral.init()
}));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

View File

@ -4,6 +4,7 @@ $(document).on('click', '.button-ajax', function (e) {
var method = $(this).data('method'); var method = $(this).data('method');
var csrf = $(this).data('csrf'); var csrf = $(this).data('csrf');
var reload = $(this).data('reload'); var reload = $(this).data('reload');
var redirect = $(this).data('redirect');
axios.request({ axios.request({
url: action, url: action,
@ -20,7 +21,7 @@ $(document).on('click', '.button-ajax', function (e) {
}) })
.then(function () { .then(function () {
if (reload) { if (reload) {
window.location.reload(); window.location = redirect;
} }
}); });
}); });

View File

@ -45,7 +45,7 @@
<!--end::Menu item--> <!--end::Menu item-->
<!--begin::Menu item--> <!--begin::Menu item-->
<div class="menu-item px-5"> <div class="menu-item px-5">
<a class="button-ajax menu-link px-5" href="#" data-action="{{ route('logout') }}" data-method="post" data-csrf="{{ csrf_token() }}" data-reload="true"> <a class="button-ajax menu-link px-5" href="#" data-action="{{ route('logout') }}" data-method="post" data-csrf="{{ csrf_token() }}" data-reload="true" data-redirect="{{ route('login') }}">
Sign Out Sign Out
</a> </a>
</div> </div>

View File

@ -4,8 +4,6 @@ const path = require('path');
const ReplaceInFileWebpackPlugin = require('replace-in-file-webpack-plugin'); const ReplaceInFileWebpackPlugin = require('replace-in-file-webpack-plugin');
const rimraf = require('rimraf'); const rimraf = require('rimraf');
const WebpackRTLPlugin = require('webpack-rtl-plugin'); const WebpackRTLPlugin = require('webpack-rtl-plugin');
const del = require('del');
const fs = require('fs');
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -32,9 +30,6 @@ mix.options({
} }
}); });
// Remove existing generated assets from public folder
del.sync(['public/assets/*',]);
// Build 3rd party plugins css/js // Build 3rd party plugins css/js
mix.sass('resources/mix/plugins.scss', `public/assets/plugins/global/plugins.bundle.css`).then(() => { mix.sass('resources/mix/plugins.scss', `public/assets/plugins/global/plugins.bundle.css`).then(() => {
// remove unused preprocessed fonts folder // remove unused preprocessed fonts folder
@ -143,7 +138,6 @@ glob.sync('node_modules/+(@fortawesome|socicon|line-awesome|bootstrap-icons)/**/
(glob.sync('node_modules/jquery-chained/*.+(js)') || []).forEach(file => { (glob.sync('node_modules/jquery-chained/*.+(js)') || []).forEach(file => {
mix.copy(file, `public/assets/plugins/custom/jquery-chained/${path.basename(file)}`); mix.copy(file, `public/assets/plugins/custom/jquery-chained/${path.basename(file)}`);
}); });
// Widgets // Widgets
mix.scripts((glob.sync(`${dir}/js/widgets/**/*.js`) || []), `public/assets/js/widgets.bundle.js`); mix.scripts((glob.sync(`${dir}/js/widgets/**/*.js`) || []), `public/assets/js/widgets.bundle.js`);