diff --git a/src/layouts/authentication/sign-in/index.js b/src/layouts/authentication/sign-in/index.js index 1c235ff..8cd47ab 100644 --- a/src/layouts/authentication/sign-in/index.js +++ b/src/layouts/authentication/sign-in/index.js @@ -44,7 +44,6 @@ function Basic() { const { login } = useUser(); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); - const [role, setRole] = useState("user"); const [rememberMe, setRememberMe] = useState(false); @@ -124,12 +123,11 @@ function Basic() { if (data && data.user) { // Display a success message if applicable const userData = data.user; - setRole(userData.role); console.log(userData); login({ name: userData.User_Name, full_name: userData.Full_Name, - role: role, + role: userData.Role, email: userData.email, phone_Number: userData.Contact_Number, profession: userData.Profession, diff --git a/src/layouts/authentication/sign-up/index.js b/src/layouts/authentication/sign-up/index.js index 1a6fd9e..f7b245d 100644 --- a/src/layouts/authentication/sign-up/index.js +++ b/src/layouts/authentication/sign-up/index.js @@ -204,7 +204,7 @@ function Cover() { setShowSuccessAlert(true); setTimeout(() => { setShowSuccessAlert(false); - login({ name: email, role: "user" }); + login({ name: name, role: "user" }); navigate("/dashboard"); }, 1000); }}