AuthPage does not handle any errors
Does the default AuthPage do any error handling by default ?
I return an error in my authProvider
login()
function like this:
But the error does not appear on screen.
To show the errors to the user is it required to swizzle this component ?
I'm using the headless UI mode.
Are the errors shown through notificationProvider
?4 Replies
Hey @rhengles! I'm the kapa.ai support bot. I've searched through the docs to try to answer your question. :wave:
----------------------
Yes, the default
<AuthPage>
handles error notifications automatically. When you return an error in your authProvider
's login()
function, refine will display an error notification.
In your case, you're returning an error object with name
and message
properties:
Refine will automatically display an error notification with the provided name
and message
properties when the login
method resolves the Promise with success: false
source (https://refine.dev/docs/tutorial/understanding-authprovider/create-authprovider).
You don't need to swizzle the component to show errors to the user, as the errors are shown through the notificationProvider
by default.
----------------------<@246421183484919808> kapa.ai is still learning and improving, please let us how it did by reacting below
national-goldOP•2y ago
that's impressive !
fascinating-indigo•2y ago
yes to able to show errors require
notificationProvider