-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from rtCamp/feature/adding-gsi-demo
Implement Legacy GSI Demo
- Loading branch information
Showing
7 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -670,6 +670,10 @@ video { | |
display: grid; | ||
} | ||
|
||
.hidden { | ||
display: none; | ||
} | ||
|
||
.aspect-square { | ||
aspect-ratio: 1 / 1; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<%- 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> | ||
<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> | ||
</div> | ||
<div id="status" class="text-center text-lg mt-4"></div> | ||
</div> | ||
|
||
<script> | ||
const statusMessage = document.getElementById('status'); | ||
const signoutBtn = document.getElementById('signout-btn'); | ||
function onSignIn(googleUser) { | ||
signoutBtn.classList.remove('hidden'); | ||
const profile = googleUser.getBasicProfile(); | ||
statusMessage.textContent = 'Hello ' + profile.getName() + '!'; | ||
} | ||
function signOut() { | ||
const auth2 = gapi.auth2.getAuthInstance(); | ||
auth2.signOut().then(function () { | ||
statusMessage.textContent = ''; | ||
}); | ||
} | ||
</script> | ||
<script src="https://apis.google.com/js/platform.js" async defer></script> | ||
<%- include(commonPath + '/footer.ejs') %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const express = require('express'); | ||
const path = require('path'); | ||
const router = express.Router(); | ||
|
||
router.get('/', (req, res) => { | ||
// Send the default page | ||
res.render(path.join(__dirname,'index'), { | ||
title: 'Legacy GSI' | ||
}); | ||
}); | ||
|
||
module.exports = router; |