Auth Id grabbing record from database

This commit is contained in:
Luis Fernando Molina committed 2018-09-07 11:38:00 +02:00
1 parent 2437ac7a31
commit 9e4c86b8d9
3 files changed
+17 -9

No files matched your search

+6 -2
View File
@@ -8,8 +8,12 @@ class LoggedInUser extends Component {
displayLoggedInUser(){
const user = this.props.data.userByAuthId;
console.log(this.props);
console.log(this.props.data);
console.log(this.props.data.userByAuthId);
if(user){
if (user.firstName) {
return(
@@ -45,7 +49,7 @@ export default graphql(getUserByAuthIdQuery, { // What follows is the way to pas
options: (props) => {
return {
variables: {
id: props.authId
authId: props.authId
}
}
}
@@ -55,7 +55,6 @@ class ButtonAppBar extends Component {
let user = JSON.parse(getUser)
const authId = user.sub;
console.log(authId);
this.setState({ authId: authId });
}