Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MsalService getUser() method returns undefined #8

Open
nmagesh84 opened this issue Apr 30, 2018 · 2 comments
Open

MsalService getUser() method returns undefined #8

nmagesh84 opened this issue Apr 30, 2018 · 2 comments

Comments

@nmagesh84
Copy link

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

@geerzo
Copy link

geerzo commented May 7, 2018

It looks like it's because local user variable is never set. Looks like somewhere this.user = this.app.getUser() needs to be called.

@hrishikeshpotdar91
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants