Skip to content

Commit 95329dc

Browse files
mend
1 parent ba6a9d1 commit 95329dc

22 files changed

Lines changed: 258 additions & 211 deletions

File tree

backend/package-lock.json

Lines changed: 0 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"author": "",
1111
"license": "ISC",
1212
"dependencies": {
13-
"bcryptjs": "^2.4.3",
1413
"cors": "^2.8.5",
1514
"dotenv": "^8.2.0",
1615
"express": "^4.17.1",

backend/server/controllers/login.controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const seleccionarPorNombreU = async (req, res) => {
1717
}
1818

1919
//TODO: desencriptar contrasenia
20-
20+
2121
let pass = data[0].contrasenia;
2222

2323
if (pass != contrasenia) {
@@ -26,7 +26,7 @@ export const seleccionarPorNombreU = async (req, res) => {
2626
.json({ errors: [{ msg: 'Credenciales invalidas' }] });
2727
}
2828

29-
console.log(data[0]);
29+
// console.log(data[0]);
3030

3131
const payload = {
3232
usuario: {

backend/server/middlewares/admin.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ module.exports = async (req, res, next) => {
1616

1717
const cargo = decoded.usuario.nombre_tipo_usuario;
1818

19-
console.log(decoded);
20-
2119
//si el cargo en el token no es ADMIN se deniega acceso a esta ruta
2220
if (cargo != 'ADMIN') {
2321
return res.status(401).json({ msg: 'acceso denegado' });

backend/server/middlewares/cajero.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ module.exports = async (req, res, next) => {
1616

1717
const cargo = decoded.usuario.nombre_tipo_usuario;
1818

19-
console.log(decoded);
20-
2119
//si el cargo en el token no es CAJERO se deniega acceso a esta ruta
2220
if (cargo != 'CAJERO') {
2321
return res.status(401).json({ msg: 'acceso denegado' });

backend/server/models/Server.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ export class Server {
2727
}
2828

2929
middlewares() {
30-
this.app.use(cors({ origin: 'http://localhost:3000' }));
30+
this.app.use(
31+
cors({ origin: ['http://localhost:3000', 'http://localhost:5000'] })
32+
);
3133
this.app.use(express.json());
3234
this.app.use(express.urlencoded({ extended: true }));
3335
this.app.use(morgan('dev'));

frontend/src/components/Error.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ const Error = ({ mensaje }) => (
44
<p className='alert-danger text-center pt-3 pb-3 texto-grande'>{mensaje}</p>
55
);
66

7-
export default Error;
7+
export default Error;

frontend/src/components/Header.jsx

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,46 @@ const Header = () => {
1111
};
1212
const estilos = {
1313
maxWidth: '100%',
14-
maxHeight: '4em'
14+
maxHeight: '2em'
1515
};
1616
return (
1717
<>
18+
<nav className="navbar navbar-dark bg-dark">
19+
<div className="container">
20+
<span className="navbar-brand">
21+
Peruvian Restaurant
22+
</span>
23+
<input
24+
className="btn text-white"
25+
type="button"
26+
value="Cerrar Sesión"
27+
onClick={cerrarSesion}
28+
/>
29+
</div>
30+
</nav>
31+
</>
32+
);
33+
};
34+
35+
export default Header;
36+
37+
/*
1838
<nav className="navbar navbar-light bg-light">
1939
<div className="container-fluid">
20-
<span className="navbar-brand">
2140
<img
22-
src={process.env.PUBLIC_URL + '/logo-res.png'}
41+
src={process.env.PUBLIC_URL + '/logo-res2.png'}
2342
alt="logo"
2443
className="img-fluid"
2544
style={estilos}
2645
/>
27-
</span>
46+
2847
<input
29-
className="btn btn-primary"
48+
className="btn"
3049
type="button"
3150
value="Cerrar Sesión"
3251
onClick={cerrarSesion}
3352
/>
3453
</div>
3554
</nav>
36-
</>
37-
);
38-
};
3955
40-
export default Header;
56+
*/
11 KB
Loading
3.13 KB
Loading

0 commit comments

Comments
 (0)