Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/deployVPS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
docker build \
--build-arg REACT_APP_BACKEND_URL=${{ secrets.BACKEND_URL }} \
--build-arg REACT_APP_BACKEND_PORT=${{ secrets.BACKEND_PORT }} \
--build-arg REACT_APP_SALT_HASH=${{ secrets.BACKEND_SALT }} \
-t ${{ secrets.DOCKER_IMAGE_NAME }}:${{ env.IMAGE_TAG }} .

- name: Push Docker image (Docker Hub)
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Create a `.env` file at the root of the project with the following variables:
```
REACT_APP_BACKEND_URL= [Database URL]
REACT_APP_BACKEND_PORT= [Database port]
REACT_APP_SALT_HASH= [SALT HASH used for the password]
```

## 🚀 Running the Project
Expand Down
10 changes: 0 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"@mui/material": "^7.0.1",
"@mui/x-data-grid": "^7.28.2",
"@testing-library/user-event": "^13.5.0",
"bcryptjs-react": "^2.4.6",
"eslint-plugin-jest": "^25.7.0",
"jest-localstorage-mock": "^2.4.26",
"react": "^18.3.1",
Expand Down
16 changes: 3 additions & 13 deletions src/Components/Manager/UserManagement/SideViewUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
import { ExpandMore, SaveRounded } from "@mui/icons-material";
import React, { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
import bcrypt from "bcryptjs-react";
import PropTypes from "prop-types";

/**
Expand Down Expand Up @@ -76,10 +75,7 @@ function SideViewUser({ user, setAlert, refreshData }) {
...newUser,
...(isNewUser &&
password.password && {
password: bcrypt.hashSync(
password.password,
process.env.REACT_APP_SALT_HASH
),
password: password.password
}),
};

Expand Down Expand Up @@ -108,14 +104,8 @@ function SideViewUser({ user, setAlert, refreshData }) {
Authorization: `Bearer ${localStorage.getItem("token")}`,
},
body: JSON.stringify({
oldPassword: bcrypt.hashSync(
password.oldPassword,
process.env.REACT_APP_SALT_HASH
),
newPassword: bcrypt.hashSync(
password.password,
process.env.REACT_APP_SALT_HASH
),
oldPassword: password.oldPassword,
newPassword: password.password,
}),
}
);
Expand Down
6 changes: 1 addition & 5 deletions src/Pages/Login/Login.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React, { useState, useEffect } from "react";
import { useNavigate, useLocation } from "react-router-dom";
// import logo from './logo-notext.png';
import bcrypt from "bcryptjs-react";

/**
* Component : Page, Component used to handle a User login in the POS Application. Main entry point
Expand Down Expand Up @@ -31,10 +29,8 @@ const Login = () => {
return;
}

const hasedPassword = bcrypt.hashSync(password, `${process.env.REACT_APP_SALT_HASH}`);


fetch(`${process.env.REACT_APP_BACKEND_URL}:${process.env.REACT_APP_BACKEND_PORT}/api/login?idRestaurant=${restaurantID}&username=${username}&password=${hasedPassword}`)
fetch(`${process.env.REACT_APP_BACKEND_URL}:${process.env.REACT_APP_BACKEND_PORT}/api/login?idRestaurant=${restaurantID}&username=${username}&password=${password}`)
.then(response => {
if (response.status === 400)
setError('Username or password is incorrect');
Expand Down