MsalService getUser() method returns undefined
Hi,
The getUser() method returns promise, when accessed to get the user details, it is always undefined.
I'm connecting to Azure B2C tenant, to authenticate.
this.service.getUser().then(userInfo => console.log(userInfo));
I get the token and authenticated bool value correctly. this.service.getToken().then(token => console.log('token: ' + token)); this.service.authenticated.then(auth => console.log('auth: ' + auth));
Regards, Magesh
It looks like it's because local user variable is never set. Looks like somewhere this.user = this.app.getUser() needs to be called.
Getting this exact same issue as nmangesh84, not able to get the user info but
this.service.getToken().then(token => console.log('token: ' + token)); this.service.authenticated.then(auth => console.log('auth: ' + auth));
both the above calls return the right data.