benbaran / adal-angular4

Angular 4/5/6/7 ADAL Wrapper
MIT License
86 stars 104 forks source link

Username always undefined #35

Closed petinho closed 6 years ago

petinho commented 6 years ago

After login I'm receiving the username as undefined.

Debugging I've seen that the variable is wrong in the updateDataFromCache function: if (user) { this.user.username = user.username; this.user.profile = user.profile; this.user.token = token; this.user.error = this.context.getLoginError(); } I've changed it to (notice capital N):

this.user.username = user.userName;

Am I right?

stuarthallows commented 6 years ago

I've put in a pull request to fix this.

mikerains commented 6 years ago

I find the same condition and vote for this Pull Request.

benbaran commented 6 years ago

The pull request fixing this has been merged : )