File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ <h3 class="logo">Database Web Quickstart</h3>
74
74
75
75
< div class ="mdl-layout__header-row titlebar ">
76
76
< h3 class ="logo "> Database Web Quickstart</ h3 >
77
+ < button id ="sign-out-button " class ="mdl-button--raised mdl-button mdl-js-button mdl-js-ripple-effect "> < i class ="material-icons "> account_circle</ i > Sign out</ button >
77
78
</ div >
78
79
79
80
<!-- Navigation Bar -->
Original file line number Diff line number Diff line change @@ -126,6 +126,10 @@ h3 {
126
126
margin-left : 10px ;
127
127
color : inherit;
128
128
}
129
+ # sign-out-button {
130
+ margin : 10px ;
131
+ color : inherit;
132
+ }
129
133
.mdl-button .material-icons {
130
134
margin-top : -2px ;
131
135
}
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ var messageForm = document.getElementById('message-form');
20
20
var messageInput = document . getElementById ( 'new-post-message' ) ;
21
21
var titleInput = document . getElementById ( 'new-post-title' ) ;
22
22
var signInButton = document . getElementById ( 'sign-in-button' ) ;
23
+ var signOutButton = document . getElementById ( 'sign-out-button' ) ;
23
24
var splashPage = document . getElementById ( 'page-splash' ) ;
24
25
var addPost = document . getElementById ( 'add-post' ) ;
25
26
var addButton = document . getElementById ( 'add' ) ;
@@ -292,6 +293,11 @@ window.addEventListener('load', function() {
292
293
firebase . auth ( ) . signInWithPopup ( provider ) ;
293
294
} ) ;
294
295
296
+ // Bind Sign out button.
297
+ signOutButton . addEventListener ( 'click' , function ( ) {
298
+ firebase . auth ( ) . signOut ( ) ;
299
+ } ) ;
300
+
295
301
// Listen for auth state changes
296
302
firebase . auth ( ) . onAuthStateChanged ( function ( user ) {
297
303
if ( user ) {
You can’t perform that action at this time.
0 commit comments