Skip to content

Commit

Permalink
Merge pull request #165 from AzureAD/rn/release0.1.3
Browse files Browse the repository at this point in the history
release msal version 0.1.3
  • Loading branch information
rohitnarula7176 committed Oct 27, 2017
2 parents 83a15b3 + 2e4d339 commit 3cd8172
Show file tree
Hide file tree
Showing 17 changed files with 52 additions and 45 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ Via NPM:
Via CDN:
```JavaScript
<!-- Latest compiled and minified JavaScript -->
<script src="https://secure.aadcdn.microsoftonline-p.com/lib/1.0.0/js/msal.min.js"></script>
<script src="https://secure.aadcdn.microsoftonline-p.com/lib/0.1.3/js/msal.min.js"></script>
```

Note that msal.js is built for ES5, therefore enabling support of Internet Explorer 11. If you want to target Internet Explorer, you'll need to add a reference to promises polyfill. You might want to read more in the [FAQ](../../wiki)
```JavaScript
<!-- IE support: add promises polyfill before msal.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js" class="pre"></script>
<script src="https://secure.aadcdn.microsoftonline-p.com/lib/1.0.0/js/msal.min.js"></script>
<script src="https://secure.aadcdn.microsoftonline-p.com/lib/0.1.3/js/msal.min.js"></script>
```

## Community Help and Support
Expand Down
13 changes: 1 addition & 12 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
# 1.0.0
# 0.1.3

### Bug fixes

* Added ability to import msal as es-5 or es-6 module.
* Added webpack to create a umd bundle with a global variable Msal exported to the window object.
* Fixed bug related to browser refresh.
* Set user object from cache if available before every acquireToken request.
* Making constructor function synchronous.
* Enable logging by passing a logger in the constructor function.
### Breaking Changes:
* To access the instance of msal in the callback passed to the constructor method, use the 'this' keyword instead of the instance variable. For example:
```
var userAgentApplication = new Msal.UserAgentApplication('your_client_id', 'authority', authCallback, { logger: logger });
function authCallback(errorDesc, token, error, tokenType, instance) {
console.log(userAgentApplication)//undefined
console.log(self)// instance of userAgentApplication;
}
```
* navigateToLoginRequestUrl property is deleted from the object.

# 0.1.2
### Bug fixes
Expand Down
4 changes: 2 additions & 2 deletions devApps/ModuleSample/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "msalreact",
"version": "1.0.0",
"version": "0.1.3",
"description": "",
"main": "index.js",
"scripts": {
Expand All @@ -19,6 +19,6 @@
"tslib": "^1.8.0",
"typescript": "^2.5.3",
"webpack": "^3.7.1",
"msal": "1.0.0"
"msal": "0.1.3"
}
}
10 changes: 2 additions & 8 deletions devApps/VanillaJSTestApp/index_LoginRedirect.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,13 @@ <h1>Sending an email with msal.js and Microsoft Graph</h1>
function authCallback(errorDesc, token, error, tokenType, instance) {
//This function is called after loginRedirect and acquireTokenRedirect. Use tokenType to determine context.
//For loginRedirect, tokenType = "id_token". For acquireTokenRedirect, tokenType:"access_token".
var self = this;
if (token) {
self.acquireTokenSilent(applicationConfig.graphScopes).then(function (accessToken) {
userAgentApplication.acquireTokenSilent(applicationConfig.graphScopes).then(function (accessToken) {
// Change button to Sign Out
updateUI();
}, function (error) {
console.log(error);
self.acquireTokenPopup(applicationConfig.graphScopes).then(function (accessToken) {
userAgentApplication.acquireTokenPopup(applicationConfig.graphScopes).then(function (accessToken) {
updateUI();
}, function (error) {
console.log(error);
Expand All @@ -66,11 +65,6 @@ <h1>Sending an email with msal.js and Microsoft Graph</h1>
}
}

var user = userAgentApplication.getUser();
if (user) {
console.log(user);
}

function updateUI() {
var authButton = document.getElementById('auth');
authButton.innerHTML = 'logout';
Expand Down
14 changes: 10 additions & 4 deletions dist/msal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/msal.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/msal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/msal.min.js.map

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions lib-commonjs/UserAgentApplication.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib-commonjs/UserAgentApplication.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib-commonjs/Utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions lib-es6/UserAgentApplication.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib-es6/UserAgentApplication.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib-es6/Utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"type": "git",
"url": "https://github.com/AzureAD/microsoft-authentication-library-for-js.git"
},
"version": "1.0.0",
"version": "0.1.3",
"description": "Microsoft Authentication Library for js",
"keywords": [
"implicit",
Expand Down
10 changes: 8 additions & 2 deletions src/UserAgentApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ export class UserAgentApplication {
var isCallback = this.isCallback(urlHash);

if (isCallback) {
this.handleAuthenticationResponse(urlHash);
var self = this;
setTimeout(function () { self.handleAuthenticationResponse(urlHash); }, 0);
}
else {
var pendingCallback = this._cacheStorage.getItem(Constants.urlHash);
Expand Down Expand Up @@ -286,7 +287,12 @@ export class UserAgentApplication {
this._cacheStorage.removeItem(Constants.urlHash);

try {
this._tokenReceivedCallback(errorDesc, token, error, tokenType);
var self = this;
setTimeout(function () {
if (self._tokenReceivedCallback) {
self._tokenReceivedCallback(errorDesc, token, error, tokenType);
}
}, 0);

} catch (err) {
this._logger.error("Error occurred in token received callback function: " + err);
Expand Down
2 changes: 1 addition & 1 deletion src/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class Utils {
}

static getLibraryVersion(): string {
return "1.0.0";
return "0.1.3";
}

/*
Expand Down

0 comments on commit 3cd8172

Please sign in to comment.