Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Chanuka-ChandraYapa committed Sep 12, 2023
2 parents 35ed64e + f7fc3d7 commit dd8cf90
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/layouts/authentication/sign-in/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/authentication/sign-up/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function Cover() {
setShowSuccessAlert(true);
setTimeout(() => {
setShowSuccessAlert(false);
login({ name: email, role: "user" });
login({ name: name, role: "user" });
navigate("/dashboard");
}, 1000);
}}
Expand Down

0 comments on commit dd8cf90

Please sign in to comment.