Added profile data but clears after refresh
This commit is contained in:
@@ -107,12 +107,13 @@ const SignInForm = () => {
|
||||
httpOnly: true, // Make the cookie accessible only via HTTP (recommended for security)
|
||||
};
|
||||
|
||||
|
||||
// Set the login token in a cookie
|
||||
await setCookie("cmc-token", res.token);
|
||||
|
||||
const userProfileData = res.profile;
|
||||
dispatch({ type: 'SET_USER_PROFILE', payload: userProfileData });
|
||||
localStorage.setItem("cmc-profile", JSON.stringify(userProfileData));
|
||||
|
||||
dispatch({ type: "SET_USER_PROFILE", payload: userProfileData });
|
||||
|
||||
enqueueSnackbar("Login Successful", {
|
||||
variant: "success",
|
||||
|
||||
Reference in New Issue
Block a user