Fixed foursquare api controller to work with new token schema

This commit is contained in:
Sahat Yalkabov
2013-12-07 12:37:32 -05:00
parent dd81615dbc
commit 4144814368

View File

@ -1,13 +1,11 @@
var mongoose = require('mongoose'), var mongoose = require('mongoose');
bcrypt = require('bcrypt'); var bcrypt = require('bcrypt');
var userSchema = new mongoose.Schema({ var userSchema = new mongoose.Schema({
// Local authentication
username: { type: String, unique: true, sparse: true }, username: { type: String, unique: true, sparse: true },
password: String, password: String,
// OAuth 2.0 authentication
tokens: Array, tokens: Array,
provider: String, provider: String,
facebook: String, facebook: String,
@ -15,7 +13,6 @@ var userSchema = new mongoose.Schema({
google: String, google: String,
github: String, github: String,
// Optional profile information
profile: { profile: {
name: { type: String, default: '' }, name: { type: String, default: '' },
email: { type: String, default: '' }, email: { type: String, default: '' },
@ -24,9 +21,6 @@ var userSchema = new mongoose.Schema({
website: { type: String, default: '' }, website: { type: String, default: '' },
picture: { type: String, default: 'http://bit.ly/1cppDAL' } picture: { type: String, default: 'http://bit.ly/1cppDAL' }
} }
// API access tokens
}); });
userSchema.path('password').validate(function(password) { userSchema.path('password').validate(function(password) {