Skip to content
This repository has been archived by the owner. It is now read-only.

Commit 00b2279

Browse files
author
Prithvi Kanherkar
committed
Revert "Updating quickstart to use new patterns"
This reverts commit 2d58ab9.
1 parent f44bad7 commit 00b2279

File tree

3 files changed

+29
-29
lines changed

3 files changed

+29
-29
lines changed

JavaScriptSPA/index.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<title>Quickstart for MSAL JS</title>
55
<script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js"></script>
6-
<script src="/msal-1.0.0-preview.5.min.js"></script>
6+
<script src="/msal-1.0.0-preview.4.min.js"></script>
77
</head>
88

99
<body>
@@ -19,8 +19,8 @@
1919
<script>
2020
var msalConfig = {
2121
auth: {
22-
clientId: '90e4bba5-5f7f-4f13-88b1-369a72041df2', //This is your client ID
23-
authority: "https://login.microsoftonline.com/328d6c53-e6b9-4ea5-ad0f-bf95c9a0c6af" //This is your tenant info
22+
clientId: 'Enter_the_Application_Id_here', //This is your client ID
23+
authority: "https://login.microsoftonline.com/Enter_the_Tenant_Info_Here" //This is your tenant info
2424
},
2525
cache: {
2626
cacheLocation: "localStorage",
@@ -41,7 +41,7 @@
4141
var myMSALObj = new Msal.UserAgentApplication(msalConfig);
4242

4343
// Register Callbacks for redirect flow
44-
// myMSALObj.handleRedirectCallback(authRedirectCallBack);
44+
myMSALObj.handleRedirectCallbacks(acquireTokenRedirectCallBack, acquireTokenErrorRedirectCallBack);
4545

4646
function signIn() {
4747
myMSALObj.loginPopup(requestObj).then(function (loginResponse) {
@@ -115,18 +115,18 @@
115115
});
116116
}
117117

118-
function authRedirectCallBack(error, response) {
119-
if (error) {
120-
console.log(error);
118+
function acquireTokenRedirectCallBack(response) {
119+
if (response.tokenType === "access_token") {
120+
callMSGraph(graphConfig.graphMeEndpoint, response.accessToken, graphAPICallback);
121121
} else {
122-
if (response.tokenType === "access_token") {
123-
callMSGraph(graphConfig.graphMeEndpoint, response.accessToken, graphAPICallback);
124-
} else {
125-
console.log("token type is:" + response.tokenType);
126-
}
122+
console.log("token type is:" + response.tokenType);
127123
}
128124
}
129125

126+
function acquireTokenErrorRedirectCallBack(error) {
127+
console.log(error);
128+
}
129+
130130
function requiresInteraction(errorCode) {
131131
if (!errorCode || !errorCode.length) {
132132
return false;

JavaScriptSPA/msal-1.0.0-preview.4.min.js

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

JavaScriptSPA/msal-1.0.0-preview.5.min.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)