Please help me to hide the (success) message popup when login is successful.
If not successful, then of course error message popup is OK.
The problem is.. When login is successful, we see for a second the message and it goes to the dashboard, so the success message is annoying an useless.
Thank you.
You’re welcome, I’m glad it’s working!
You need to modify the general.js file and remove the part of the code responsible for showing the success message. Specifically, you should remove the Swal.fire code:
/resources/_keenthemes/src/js/custom/authentication/sign-in/general.js
axios.post(submitButton.closest("form").getAttribute("action"), new FormData(form)).then(function (response) {
if (response) {
form.reset();
Swal.fire({
text: "You have successfully logged in!",
icon: "success",
buttonsStyling: false,
confirmButtonText: "Ok, got it!",
customClass: {
confirmButton: "btn btn-primary"
}
});
const redirectUrl = form.getAttribute("data-kt-redirect-url");
if (redirectUrl) {
location.href = redirectUrl;
}
}
});
Thank you, it's working!
in general.js file you need to just remove
axios.post(submitButton.closest('form').getAttribute('action'), new FormData(form)).then(function (response) {
if (response) {
form.reset();
// Show message popup. For more info check the plugin's official documentation: https://sweetalert2.github.io/
Swal.fire({
text: "You have successfully logged in!",
icon: "success",
buttonsStyling: false,
confirmButtonText: "Ok, got it!",
customClass: {
confirmButton: "btn btn-primary"
}
});
const redirectUrl = form.getAttribute('data-kt-redirect-url');
if (redirectUrl) {
location.href = redirectUrl;
}
remove bold code only
Thank you, it's working!