generator-kodly-react-app 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -34,9 +34,9 @@ export const useLogin = () => {
|
|
|
34
34
|
return response.data;
|
|
35
35
|
},
|
|
36
36
|
onSuccess: (authData) => {
|
|
37
|
-
const token = authData?.token || '';
|
|
37
|
+
const token = authData?.data?.token || '';
|
|
38
38
|
setAuthToken(token);
|
|
39
|
-
setCurrentUser(authData);
|
|
39
|
+
setCurrentUser(authData.data);
|
|
40
40
|
setTokenInAxios(token);
|
|
41
41
|
navigate({ to: AppRoute.to });
|
|
42
42
|
},
|
|
@@ -54,12 +54,12 @@ export const useValidateToken = () => {
|
|
|
54
54
|
setTokenInAxios(authToken);
|
|
55
55
|
return useMutation({
|
|
56
56
|
mutationFn: async () => {
|
|
57
|
-
const response = await client.post('/auth/user/validate');
|
|
57
|
+
const response = await client.post('/auth/user/validate-token');
|
|
58
58
|
return response.data;
|
|
59
59
|
},
|
|
60
60
|
retry: false,
|
|
61
61
|
onSuccess: (data) => {
|
|
62
|
-
setCurrentUser(data);
|
|
62
|
+
setCurrentUser(data.data);
|
|
63
63
|
},
|
|
64
64
|
onError: () => {
|
|
65
65
|
setCurrentUser(undefined);
|
package/package.json
CHANGED