How can I show a success message on successfull registration?
I want the user to confirm their email before allowing them to login, but I need to communicate that to the user somehow, so is it possible to show a notification when registration was successfull (my user is being redirected to login)
4 Replies
Hi @BlackBearFTW. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Yes, you can show a success message after successful registration in refine. You can use the
useRegister
hook's onSuccess
callback to trigger a notification. However, the extracts provided do not include information on how to display a notification directly after registration.
The extracts do show how to use the NotificationProvider
with various hooks (useMany
, useTable
, useShow
, useInfiniteList
, useOne
, useList
, useUpdateMany
, useForm
) to display a success notification after data is fetched or a mutation is successful.
Here is an example of how you might use it with the useForm
hook:
In this example, a success notification is displayed after a successful mutation. The notification's message, description, and type are customizable.
You would need to implement a similar pattern with the useRegister
hook. Unfortunately, the provided extracts do not include a direct example of this. For more detailed information, you may want to refer to the refine documentation (https://refine.dev/docs).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@490961337896402944> kapa.ai is still learning and improving, please let us know how it did by reacting below
quickest-silver•8mo ago
Eh this doesn't work?
it doesn't show a success message
rare-sapphire•7mo ago
Hello @BlackBearFTW please make sure you are using latest version of refine packages. This feature is released recently, you may have older version.