This code is not showing message after user login. Did i put the code on right event? Experts please suggest me if any mistake in the coding?Thanks in advance.
You should not put Javascript code in Server Events section.If you want to just display your custom message, you may simply put this following code in that User_LoggedIn server event:
$this->setSuccessMessage("Signed in successfully.");
Hello,Use Bootstrap Toast message option is enable and $this->setSuccessMessage(“Signed in successfully.”); also showing message. But Toast with sweetalert2 mix is more graphical thats why if possible i wanted to use this in my project. I saw a post on this forum which is relevant to my expectation. Discussion link is : https://discourse.hkvstore.com/t/how-to-add-toast-message-on-successful-login/5026/4 tried the below code on Server Events → Page Foot. No error is showing but message is also not appearing:
There is no $_SESSION[‘success_login’] unless you set it somewhere yourself.
You better use the “toast” event to open your own toast, e.g.
$(document).on("toast", (args) => {
// console.log(args); // View the args first and see what you can use
args.show = false; // Disable the default toast
// your own code to open your own toast using the info from args
// ...
});