Skip to content

Commit

Permalink
Seccion 12 terminada - backend
Browse files Browse the repository at this point in the history
  • Loading branch information
matibm committed Nov 30, 2019
1 parent 35bc388 commit bac4d51
Show file tree
Hide file tree
Showing 10 changed files with 3,899 additions and 2 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Backend-Server

Este es el codigo necesario para establecer el backend conectado a MongoDB usando Mongoose.

Para ejecutarlo, es necesario reconstruir los modulos de node usando el comando

```
npm install
```

## Dentro de Google-Signin-demo
Existe un pequeño ejercicio para probar la autenticacion de Google en un Front-End Basico pero funcional.
5 changes: 4 additions & 1 deletion config/config.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
module.exports.SEED = '@este-es@-un-seed-dificil'
module.exports.SEED = '@este-es@-un-seed-dificil'


module.exports.CLIENT_ID = '1034761070877-v0p1d8hjp2479lo0ii86c8c8rgv38m0j.apps.googleusercontent.com';
42 changes: 42 additions & 0 deletions google-signin-demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Google signin Demo</title>

<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="1034761070877-v0p1d8hjp2479lo0ii86c8c8rgv38m0j.apps.googleusercontent.com">

</head>

<body>

<div class="g-signin2" data-onsuccess="onSignIn"></div>
<a href="#" onclick="signOut();">Sign out</a>

<script>
function signOut() {
var auth2 = gapi.auth2.getAuthInstance();
auth2.signOut().then(function() {
console.log('User signed out.');
});
}
</script>

<script>
function onSignIn(googleUser) {
var profile = googleUser.getBasicProfile();
console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
console.log('Name: ' + profile.getName());
console.log('Image URL: ' + profile.getImageUrl());
console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.
var id_token = googleUser.getAuthResponse().id_token;
console.log('Token: ' + id_token);
}
</script>
</body>

</html>
3 changes: 3 additions & 0 deletions google-signin-demo/ls-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"port": 4200
}
Loading

0 comments on commit bac4d51

Please sign in to comment.