Skip to content

Commit

Permalink
Autenticacion de Google
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbobbio1@gmail.com committed Oct 26, 2018
1 parent cfcbccb commit 891716a
Show file tree
Hide file tree
Showing 5 changed files with 277 additions and 15 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Backend-Server

Este es el código para esablecer el backend conectado a MongoDB usando Mongoose

Para ejecutarlo, es necesario reconstruir los módulos de node usando el comando

```
npm install
```
3 changes: 2 additions & 1 deletion models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ var userSchema = new Schema({
email: { type: String, required: [true, "The email is required"], unique:true, },
password: { type: String, required: [true, "The password is required"] },
img: { type: String, required: false },
role: { type: String, required: false, default: 'USER_ROLE', enum:rolesValid }
role: { type: String, required: false, default: 'USER_ROLE', enum:rolesValid },
google: { type:Boolean, default:false }
});
userSchema.plugin(uniqueValidator, {message: '{PATH} The email is unique'});

Expand Down
164 changes: 164 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"body-parser": "^1.18.3",
"express": "^4.16.4",
"express-fileupload": "^1.0.0",
"google-auth-library": "^2.0.0",
"jsonwebtoken": "^8.3.0",
"mongoose": "^5.3.4",
"mongoose-unique-validator": "^2.0.2"
Expand Down
Loading

0 comments on commit 891716a

Please sign in to comment.