So for some reason Meteor.user() is coming undefined for me even though I’m logged in.
I’m using Webstorm so it tells me on telling me module not installed when I import meteor from ‘meteor/meteor’
This is my first project in React with Meteor maybe I haven’t installed some specific modules. Here is my code
//Importing Packages
import React, { Component } from 'react';
import { Meteor } from 'meteor/meteor';
import { Redirect } from 'react-router-dom'
//Importing Local Components/Files
import Lost from '../../notFound/Lost';
export default class FinishRegister extends Component {
logValue(){
console.log(Meteor.user());
return Meteor.user()
}
serviceCheck(service){
Meteor.call('finishRegister',service,(error, result) => {
if (error) {
alert(error);
} else {
return result;
}
});
}
lowerCasing(){
return this.props.match.params.service.toLowerCase();
}
render() {
if (this.logValue()){
if (this.serviceCheck(this.lowerCasing())){
return (
SOME CODE
);
}else{
return <Lost/>
}
}else {
return <Redirect to='/login' />
}
}
}
Here is a screenshot of my console. The Undefined part id from logValue function in the code I sent.