Skip to content

Commit 097deff

Browse files
committed
minor review changes
1 parent 6ae9543 commit 097deff

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

1-Authentication/2-sign-in-b2c/App/authPopup.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ const myMSALObj = new msal.PublicClientApplication(msalConfig);
55
let accountId = '';
66
let username = '';
77

8+
/**
9+
* This method adds an event callback function to the MSAL object
10+
* to handle the response from redirect flow. For more information, visit:
11+
* https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/events.md
12+
*/
813
myMSALObj.addEventCallback((event) => {
914
console.log(event.eventType);
1015
if (
@@ -172,7 +177,6 @@ function signOut() {
172177

173178
const logoutRequest = {
174179
mainWindowRedirectUri: 'http://localhost:6420/signout',
175-
redirectUri: '/redirect',
176180
};
177181

178182
myMSALObj.logoutPopup(logoutRequest);

1-Authentication/2-sign-in-b2c/App/authRedirect.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ let accountId = '';
66
let username = '';
77
let accessToken = null;
88

9+
/**
10+
* This method adds an event callback function to the MSAL object
11+
* to handle the response from redirect flow. For more information, visit:
12+
* https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/events.md
13+
*/
914
myMSALObj.addEventCallback((event) => {
1015
if (
1116
(event.eventType === msal.EventType.LOGIN_SUCCESS ||
@@ -55,7 +60,6 @@ myMSALObj.addEventCallback((event) => {
5560
* you can replace the code below with the same pattern used for handling the return from
5661
* profile edit flow
5762
*/
58-
5963
if (event.payload.idTokenClaims['tfp'] === b2cPolicies.names.forgotPassword) {
6064
myMSALObj.loginRedirect(b2cPolicies.authorities.signUpSignIn).catch((error) => {
6165
console.log(error);
@@ -185,7 +189,6 @@ function getTokenRedirect(request) {
185189
return handleResponse(response);
186190
})
187191
.catch((error) => {
188-
console.log(error);
189192
console.log('silent token acquisition fails. acquiring token using popup');
190193
if (error instanceof msal.InteractionRequiredAuthError) {
191194
// fallback to interaction when silent call fails

1-Authentication/2-sign-in-b2c/App/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<body>
2121
<nav class="navbar navbar-expand-lg navbar-dark bg-primary navbarStyle">
2222
<a class="navbar-brand" href="/">Azure AD B2C</a>
23-
<div class="navbar-collapse justify-content-end">
23+
<div class="navbar navbar-collapse justify-content-end">
2424
<button type="button" id="editProfileButton" class="btn btn-secondary d-none profileButton" onclick="editProfile()">Edit
2525
Profile</button>
2626
<button type="button" id="signIn" class="btn btn-secondary" onclick="signIn()">Sign-in</button>
@@ -67,7 +67,6 @@ <h5 id="welcome-div" class="card-header text-center d-none"></h5>
6767
<script type="text/javascript" src="./ui.js"></script>
6868
<script type="text/javascript" src="./utils/claimUtils.js"></script>
6969

70-
7170
<!-- <script type="text/javascript" src="./authRedirect.js"></script> -->
7271
<!-- uncomment the above line and comment the line below if you would like to use the redirect flow -->
7372
<script type="text/javascript" src="./authPopup.js"></script>

1-Authentication/2-sign-in-b2c/App/redirect.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
we recommend setting the redirectUri to a blank page or a page that does not implement MSAL.
44
For more information, please follow this link:
55
https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/login-user.md#redirecturi-considerations
6-
-->
7-
<h1>MSAL Redirect</h1>
6+
-->

1-Authentication/2-sign-in-b2c/App/utils/claimUtils.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,4 @@ const populateClaim = (claim, value, description, index, claimsObject) => {
221221
const changeDateFormat = (date) => {
222222
let dateObj = new Date(date * 1000);
223223
return `${date} - [${dateObj.toString()}]`;
224-
};
225-
226-
if (typeof exports !== 'undefined') {
227-
module.exports = {
228-
createClaimsTable: createClaimsTable,
229-
};
230-
}
224+
};

0 commit comments

Comments
 (0)