Skip to content

Instantly share code, notes, and snippets.

@Rishabh570
Last active May 11, 2022 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rishabh570/79b106bec5f420bfa7da1088cc35f3a6 to your computer and use it in GitHub Desktop.
Save Rishabh570/79b106bec5f420bfa7da1088cc35f3a6 to your computer and use it in GitHub Desktop.
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// Schema to store the information about other logged in accounts
const accountSchema = new Schema({
name: String,
userId: String,
email: String
});
// create User Schema
var UserSchema = new Schema({
name: String,
connectedSocialAccounts: {
type: Number,
default: 1
},
otherAccounts: [accountSchema],
google: {
accessToken: String,
email: String,
profileId: String,
},
github: {
accessToken: String,
email: String,
profileId: String,
},
facebook: {
accessToken: String,
email: String,
profileId: String,
}
});
const User = mongoose.model('users', UserSchema);
module.exports = User;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment