var express = require('express');
var sequelize = require('../sequelize');
var Sequelize = require('sequelize');
var name = 'testname';

var getname = function(inname){
	return inname;
}

var user = sequelize.define('user', {
	id: {
		type: Sequelize.STRING,
		unique: true,
		primaryKey: true,
		validate: {
			notEmpty: true,
			isUnique: function(value, next) {
				user.find({
					where: {
						id: value
					}
				}).then(function (user) {
					if (user) {
						return next ('User already exist!');
					}
					return next ();
				}).catch(function (err) {
					return next (err);
				});
			}
		}
	},
	name: {
		type: Sequelize.STRING
	},
	email: {
		type: Sequelize.STRING
	},
	gender: {
		type: Sequelize.ENUM('Male', 'Female')
	},
	token: {
		type: Sequelize.STRING
	},

}, {
	instanceMethods: {
		toJSON: function () {
			var values = this.get();
			delete values.token;
			return values;
		}
	},
});

sequelize.sync({});

module.exports = user;
module.exports.getname = getname;
@@ -767,24 +767,29 @@
 elize.STRING
+(511)
 %0A%09%7D,%0A%0A%7D, %7B%0A%09

Fix Token Length