custom messsage on event notification
Hi everyone, i am currently working on permission on my refine app. I allow only admin user to login to the app. To do that, i write this code in the
That i would like to know is how can i customize the nottification message which appear when a non admin account try to log in the app because currently i have a message which tel : "invalid credential" like on the picture and would to write something else in the notification.
login
method in the authProvider which work fine.That i would like to know is how can i customize the nottification message which appear when a non admin account try to log in the app because currently i have a message which tel : "invalid credential" like on the picture and would to write something else in the notification.
5 Replies
Hey, I am refine support bot :wave:. I am here to help you with your question. I searched for the answer to your question in the refine documentation and could not find an answer. Please wait for someone from the refine core team or the community to try to help you. 👊
robust-apricot•2y ago
Hello @harisris , while rejecting the promise, you can pass an object with
name
and message
keys, then notification will be sent to the user
flat-fuchsiaOP•2y ago
Hello @batuhanw i tried your code snipped but it does not work, i always have the same message in the notification
here is my login function if i have done something wrong
robust-apricot•2y ago
Hello @harisris I think your Promise.reject is caught by catch in the end
I would suggest converting this whole function to async function and use await syntax. It will be more readable and easier to catch errors this way.
flat-fuchsiaOP•2y ago
Thank you @batuhanw i'll do that 💪