Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var employee =
- {
- empCode : { type : String , unique: true , required : true },
- firstName : { type : String , required : true },
- lastName : { type : String },
- email : { type : String },
- DOJ :{ type : Date , default: Date.now },
- DOB :{ type : Date },
- phoneNo : { type : String },
- authentication :
- {
- username : { type : String },
- password : { type : String }
- },
- status : {type:Boolean}
- };
- loginController.prototype.userValidator = function(req , callback){
- objDB.selectOne(objMdlEmployee , { authentication.username : req.username , authentication.password : req.password } , function(err , ObjDocument){
- if(err){
- callback(false , config.msg.SOMTHING_WRONG);
- }else if(ObjDocument===null){
- callback(false , config.msg.AUTH_FAIL);
- }
- else {
- req.session.sessUser = {
- userAuthenticate : true,
- firstName : ObjDocument.firstName,
- employeeId : ObjDocument.employeeId
- }
- callback(true , 'Valid');
- }
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement