Server: AuthID passed from decoded token via context

This commit is contained in:
Barry Low committed 2018-09-10 22:13:10 -07:00
1 parent 0669921d0e
commit 12e055ee80
6 files changed
+29 -29

No files matched your search

+1 -9
View File
@@ -52,12 +52,4 @@ class LoggedInUser extends Component {
}
}
export default graphql(getUserByAuthIdQuery, { // What follows is the way to pass a parameter to a query.
options: (props) => {
return {
variables: {
authId: props.authId
}
}
}
})(LoggedInUser); // This binds the querty to the component
export default graphql(getUserByAuthIdQuery)(LoggedInUser); // This binds the querty to the component
+1 -1
View File
@@ -53,7 +53,7 @@ class NavBar extends Component {
const userStored = localStorage.getItem('user');
if (userStored !== null && userStored !== undefined && userStored !== 'undefined') {
const user = JSON.parse(userStored);
const user = userStored;
/* For some reason, the result of GraphQL some times varies, that is why I had to do the following hack. */