From 9551a5fe87d004b5e45b695fef90ab3df4770be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Santiago=20Cort=C3=A9s=20Fern=C3=A1ndez?= Date: Tue, 17 Apr 2018 06:43:03 -0500 Subject: [PATCH] Comentarios sobre elementos del App Se colocaron algunos comentarios sobre modificaciones que pueden ser realizadas. Para el manejo de roles se recomienda utilizar alanning:roles --- imports/ui/App.jsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/imports/ui/App.jsx b/imports/ui/App.jsx index 0034e39..87e6c3a 100644 --- a/imports/ui/App.jsx +++ b/imports/ui/App.jsx @@ -25,7 +25,9 @@ class App extends Component { user: Meteor.user() }; } - + + //Quitar codigo comentado + // componentWillMount() { // if(!this.state.isAuthenticated) { // this.props.history.push("/Home"); @@ -57,6 +59,8 @@ class App extends Component { Meteor.logout((err) => { if(err) { console.log(err.reason); + //Si llega a haber un error, seria util mostrarlo de alguna + //forma en el browser para mantener informado al usuario } }); } @@ -66,13 +70,17 @@ class App extends Component { render() { let currUsr = this.state.user; - + + //Quitar impresiones en concola: Puede llegar a ser un riesgo darle a los usuarios las listas de restaurantes console.log(this.state.user); console.log(this.props.restaurants); return (
+ { + //Modificar el uso de roles: Colocar roles en el Profile es un riesgo de seguridad + } {this.state.user.profile.role === "restaurant" ? () : ()} @@ -104,4 +112,4 @@ export default withTracker(() => { restaurants: Restaurantes.find({ owner: Meteor.userId() }).fetch(), currentUser: Meteor.user() }; -})(App); \ No newline at end of file +})(App);