Server: AuthID passed from decoded token via context
This commit is contained in:
1 parent
0669921d0e
commit
12e055ee80
6 files changed
+29
-29
No files matched your search
@@ -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
|
||||
@@ -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. */
|
||||
|
||||
|
||||
Reference in new issue
Block a user