Skip to content

Commit

Permalink
Add logout functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenVerborgh committed Sep 25, 2018
1 parent 5c0dfa1 commit 24ef8a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ <h1>Profile viewer</h1>
</p>
<p id="logout">
You are logged in as <span id="user"></span>.
<button>Log out</button>
</p>
<script src="scripts/jquery.js"></script>
<script src="scripts/solid-auth-client.bundle.js"></script>
Expand Down
5 changes: 3 additions & 2 deletions scripts/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Log the user in on click
// Log the user in and out on click
const popupUri = 'popup.html';
$('#login button').click(() => solid.auth.popupLogin({ popupUri }));
$('#login button').click(() => solid.auth.popupLogin({ popupUri }));
$('#logout button').click(() => solid.auth.logout());

// Update components to match the user's login status
solid.auth.trackSession(session => {
Expand Down

0 comments on commit 24ef8a4

Please sign in to comment.