mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-15 14:19:41 -06:00
Removed log statement, saved authToken to auth state
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user