Skip to content

Commit

Permalink
Merge pull request #39 from rtCamp/fix/remove-sign-out-botton-after-l…
Browse files Browse the repository at this point in the history
…ogout

Remove sign out button after user logout
  • Loading branch information
fellyph authored Feb 2, 2024
2 parents 42ae328 + 511fd09 commit 0b3dd37
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions public/assets/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,11 @@ video {
padding-right: 1rem;
}

.py-1 {
padding-top: 0.25rem;
padding-bottom: 0.25rem;
}

.py-2 {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
Expand Down
8 changes: 4 additions & 4 deletions src/scenarios/gsi/index.ejs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<%- include(commonPath + '/header.ejs') %>

<div class="container mx-auto py-8">
<h1 class="text-3xl font-bold mb-4 text-center">Legacy Google Sign-in</h1>
<%- include(commonPath + '/internal-page/header.ejs') %>
<p class="text-lg font-bold mb-4 text-center">Please login to test this demo.</p>
<div class="flex justify-center">
<div class="g-signin2" data-onsuccess="onSignIn"></div>
<button id="signout-btn" class="hidden ml-4 bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded" onclick="signOut()">Sign Out</button>
<button id="signout-btn" class="hidden ml-4 bg-blue-500 hover:bg-blue-700 text-white font-bold py-1 px-4 rounded" onclick="signOut()">Sign Out</button>
</div>
<div id="status" class="text-center text-lg mt-4"></div>
</div>
<%- include(commonPath + '/internal-page/footer.ejs') %>

<script>
const statusMessage = document.getElementById('status');
Expand All @@ -24,6 +23,7 @@
const auth2 = gapi.auth2.getAuthInstance();
auth2.signOut().then(function () {
statusMessage.textContent = '';
signoutBtn.classList.add('hidden');
});
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/scenarios/gsi/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const router = express.Router();
router.get('/', (req, res) => {
// Send the default page
res.render(path.join(__dirname,'index'), {
title: 'Legacy GSI'
title: 'Legacy Google Sign-in'
});
});

Expand Down

0 comments on commit 0b3dd37

Please sign in to comment.