We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84a9b3d commit 91aaf75Copy full SHA for 91aaf75
.changeset/green-goats-fail.md
@@ -0,0 +1,7 @@
1
+---
2
+"@refinedev/core": patch
3
4
+
5
+Move invalidation in `useRegister` to be called only on success.
6
7
+[Resolves #6639](https://github.com/refinedev/refine/issues/6639)
packages/core/src/hooks/auth/useRegister/index.ts
@@ -131,6 +131,8 @@ export function useRegister<TVariables = {}>({
131
if (successNotification) {
132
open?.(buildSuccessNotification(successNotification));
133
}
134
135
+ await invalidateAuthStore();
136
137
138
if (error || !success) {
@@ -148,8 +150,6 @@ export function useRegister<TVariables = {}>({
148
150
replace("/");
149
151
152
-
- await invalidateAuthStore();
153
},
154
onError: (error: any) => {
155
open?.(buildNotification(error));
0 commit comments