From a12e200e332c3bfd792cda5f9cff2648c9b117db Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Mon, 10 Jun 2024 14:28:31 -0700 Subject: [PATCH] Removed log statement, saved authToken to auth state --- Client/src/Features/Auth/authSlice.js | 2 ++ Client/src/Layouts/HomeLayout/index.jsx | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Client/src/Features/Auth/authSlice.js b/Client/src/Features/Auth/authSlice.js index 2182acef5..ebf8eb7bd 100644 --- a/Client/src/Features/Auth/authSlice.js +++ b/Client/src/Features/Auth/authSlice.js @@ -5,6 +5,7 @@ const BASE_URL = import.meta.env.VITE_APP_API_BASE_URL; const initialState = { isLoading: false, + authToken: "", user: "", success: null, msg: null, @@ -35,6 +36,7 @@ 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; diff --git a/Client/src/Layouts/HomeLayout/index.jsx b/Client/src/Layouts/HomeLayout/index.jsx index d7a7c2977..963c0d0a7 100644 --- a/Client/src/Layouts/HomeLayout/index.jsx +++ b/Client/src/Layouts/HomeLayout/index.jsx @@ -10,7 +10,6 @@ import { useSelector } from "react-redux"; const HomeLayout = () => { const authState = useSelector((state) => state.auth); const { user, msg } = authState; - console.log(user, msg); return (