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

+13 -1
View File
@@ -2,12 +2,24 @@ import { configureStore, combineReducers } from "@reduxjs/toolkit";
import monitorsReducer from "./Features/Monitors/monitorsSlice";
import authReducer from "./Features/Auth/authSlice";
import storage from "redux-persist/lib/storage";
import { persistReducer, persistStore } from "redux-persist";
import { persistReducer, persistStore, createTransform } from "redux-persist";
const authTransform = createTransform(
(inboundState) => {
const { profileImage, ...rest } = inboundState;
return rest;
},
// No transformation on rehydration
null,
// Only applies to auth
{ whitelist: ["auth"] }
);
const persistConfig = {
key: "root",
storage,
whitielist: ["auth", "monitors"],
transforms: [authTransform],
};
const rootReducer = combineReducers({