Removed log statement, saved authToken to auth state

This commit is contained in:
Alex Holliday
2024-06-10 14:28:31 -07:00
parent 44c9659b1d
commit a12e200e33
2 changed files with 2 additions and 1 deletions

View File

@@ -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;

View File

@@ -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 (
<div className="home-layout">
<DashboardSidebar />