This repository has been archived by the owner. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 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 ">
Original file line number Diff line number Diff line change 11// UI elements to work with
2- const signInButton = document . getElementById ( 'SignIn ' ) ;
2+ const signInButton = document . getElementById ( 'signIn ' ) ;
33signInButton . addEventListener ( 'click' , signIn ) ;
44
5+ const signOutButton = document . getElementById ( 'signOut' ) ;
6+ signOutButton . addEventListener ( 'click' , logout ) ;
7+
58const callWebApiButton = document . getElementById ( 'callApiButton' ) ;
69
710const label = document . getElementById ( 'label' ) ;
@@ -11,12 +14,9 @@ const response = document.getElementById("response");
1114function 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 ;
You can’t perform that action at this time.
0 commit comments