AzureAD / azure-activedirectory-library-for-js

The code for ADAL.js and ADAL Angular has been moved to the MSAL.js repo. Please open any issues or PRs at the link below.
https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/maintenance/adal-angular
Apache License 2.0
627 stars 372 forks source link

Call getCachedUser in acquireToken to avoid bugs related to renew #857

Closed atlefren closed 4 years ago

atlefren commented 5 years ago

Directly calling this._user in acquireToken will result in a "User login is required" error if the page has been reloaded.

The fix is to call getCachedUser, so that user is loaded from cache.

This solves #764

PR against master as this is a pressing issue that should be fixed asap. Please advice if I should use another branch.

atlefren commented 5 years ago

Hmm, no idea why tests fail: they work fine on my machine:

atlefren@atlsve-M4800:~/code/azure-activedirectory-library-for-js [issue_764]$ npm test

> adal-angular@1.0.17 test /mnt/d/code/azure-activedirectory-library-for-js
> jasmine-node tests/unit/spec

.........Waiting for initial timeout
.Waiting for initial timeout
.............................Waiting for initial timeout
..................

Finished in 2.355 seconds
57 tests, 168 assertions, 0 failures, 0 skipped