Skip to content

Commit 3784d3a

Browse files
committed
Seccion backend con Google terminado
1 parent 5a40398 commit 3784d3a

12 files changed

+3845
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules/
2+
Google-SignIn-Demo/node_modules/
23
.idea/
34
.idea
45

Google-SignIn-Demo/index.html

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Google - SignIn demo</title>
6+
<script src="https://apis.google.com/js/platform.js" async defer></script>
7+
<meta name="google-signin-client_id" content="300725710956-2m7rk1dv5hkhhghkscbiu0er1gckaoj9.apps.googleusercontent.com">
8+
</head>
9+
<body>
10+
<div class="g-signin2" data-onsuccess="onSignIn"></div>
11+
12+
<a href="#" onclick="signOut();">Sign out</a>
13+
14+
<script>
15+
function signOut() {
16+
var auth2 = gapi.auth2.getAuthInstance();
17+
auth2.signOut().then(function () {
18+
console.log('User signed out.');
19+
});
20+
}
21+
</script>
22+
<script>
23+
function onSignIn(googleUser) {
24+
var profile = googleUser.getBasicProfile();
25+
console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
26+
console.log('Name: ' + profile.getName());
27+
console.log('Image URL: ' + profile.getImageUrl());
28+
console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.
29+
var id_token = googleUser.getAuthResponse().id_token;
30+
console.log('Token '+id_token);
31+
}
32+
</script>
33+
</body>
34+
</html>

Google-SignIn-Demo/ls-config.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"port": 4200
3+
}

0 commit comments

Comments
 (0)