Return user and Token instead of decoding token. Added transform to not store image in redux store

This commit is contained in:
Alex Holliday committed 2024-07-03 12:20:30 -07:00
1 parent 440716b021
commit f97aa1ca8c
4 files changed
+26 -18

No files matched your search

+2 -4
View File
@@ -67,10 +67,8 @@ const handleAuthFulfilled = (state, action) => {
state.isLoading = false;
state.success = action.payload.success;
state.msg = action.payload.msg;
state.authToken = action.payload.data;
const decodedToken = jwtDecode(action.payload.data);
const user = { ...decodedToken };
state.user = user;
state.authToken = action.payload.data.token;
state.user = action.payload.data.user;
};
const handleAuthRejected = (state, action) => {
state.isLoading = false;