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

Commit 9426e23

Browse files
committed
review requests2
1 parent c45e34b commit 9426e23

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

JavaScriptSPA/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
2424
<a class="navbar-brand" href="/">Azure AD B2C</a>
2525
<div class="btn-group ml-auto dropleft">
26-
<button type="button" id="SignIn" class="btn btn-secondary">Sign In</button>
26+
<button type="button" id="signIn" class="btn btn-secondary">Sign In</button>
27+
<button type="button" id="signOut" class="btn btn-success" style="display:none">Sign Out</button>
2728
</div>
2829
</nav>
2930
<div class="card">

JavaScriptSPA/ui.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// UI elements to work with
2-
const signInButton = document.getElementById('SignIn');
2+
const signInButton = document.getElementById('signIn');
33
signInButton.addEventListener('click', signIn);
44

5+
const signOutButton = document.getElementById('signOut');
6+
signOutButton.addEventListener('click', logout);
7+
58
const callWebApiButton = document.getElementById('callApiButton');
69

710
const label = document.getElementById('label');
@@ -11,12 +14,9 @@ const response = document.getElementById("response");
1114
function updateUI() {
1215
const userName = myMSALObj.getAccount().name;
1316
logMessage("User '" + userName + "' logged-in");
14-
15-
// add the logout button
16-
signInButton.innerHTML = 'logout';
17-
signInButton.setAttribute('class', "btn btn-success ml-auto")
18-
signInButton.removeEventListener('click', signIn);
19-
signInButton.addEventListener('click', logout);
17+
18+
signInButton.style.display = 'none';
19+
signOutButton.style.display = 'initial';
2020

2121
// greet the user - specifying login
2222
label.innerText = "Hello " + userName;

0 commit comments

Comments
 (0)