Built motion from commit ab065936.|2.0.53
[motion2.git] / server / api / authLocal / authLocal.controller.js
index ad3e404..51e2f65 100644 (file)
@@ -1 +1 @@
-var _0x71ea=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x75\x74\x69\x6C","\x70\x61\x73\x73\x70\x6F\x72\x74","\x53\x74\x72\x61\x74\x65\x67\x79","\x70\x61\x73\x73\x70\x6F\x72\x74\x2D\x6C\x6F\x63\x61\x6C","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6A\x61\x79\x73\x6F\x6E\x2F\x70\x72\x6F\x6D\x69\x73\x65","\x6C\x6F\x64\x61\x73\x68","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72","\x72\x61\x6E\x64\x6F\x6D\x73\x74\x72\x69\x6E\x67","\x64\x62","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x79\x73\x71\x6C\x64\x62","\x73\x69\x67\x6E\x54\x6F\x6B\x65\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6D\x70\x6F\x6E\x65\x6E\x74\x73\x2F\x61\x75\x74\x68\x2F\x73\x65\x72\x76\x69\x63\x65","\x68\x74\x74\x70","\x63\x6C\x69\x65\x6E\x74","\x72\x6F\x6C\x65","\x61\x67\x65\x6E\x74","\x63\x61\x74\x63\x68","\x61\x67\x65\x6E\x74\x73","\x4D\x61\x78\x69\x6D\x75\x6D\x20\x6C\x6F\x67\x69\x6E\x20\x68\x61\x73\x20\x62\x65\x65\x6E\x20\x72\x65\x61\x63\x68\x65\x64","\x74\x68\x65\x6E","\x67\x65\x74\x4C\x69\x63\x65\x6E\x73\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x69\x63\x65\x6E\x73\x65\x2F\x75\x74\x69\x6C","\x69\x64","\x63\x6F\x75\x6E\x74","\x55\x73\x65\x72","\x54\x68\x69\x73\x20\x70\x61\x73\x73\x77\x6F\x72\x64\x20\x69\x73\x20\x6E\x6F\x74\x20\x63\x6F\x72\x72\x65\x63\x74\x2E","\x61\x75\x74\x68\x65\x6E\x74\x69\x63\x61\x74\x65","\x54\x68\x69\x73\x20\x6E\x61\x6D\x65\x20\x69\x73\x20\x6E\x6F\x74\x20\x72\x65\x67\x69\x73\x74\x65\x72\x65\x64\x2E","\x74\x72\x69\x6D","\x61\x64\x6D\x69\x6E","\x75\x73\x65\x72","\x66\x69\x6E\x64","\x65\x72\x72\x6F\x72","\x53\x65\x6E\x64\x4D\x61\x69\x6C\x20\x65\x72\x72\x6F\x72\x3A\x20\x25\x73\x2E\x20\x50\x6C\x65\x61\x73\x65\x20\x63\x6F\x6E\x74\x61\x63\x74\x20\x79\x6F\x75\x72\x20\x41\x64\x6D\x69\x6E\x69\x73\x74\x72\x61\x74\x6F\x72\x21","\x6D\x65\x73\x73\x61\x67\x65","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x66\x6F\x72\x6D\x61\x74","\x55\x6E\x61\x62\x6C\x65\x20\x74\x6F\x20\x66\x69\x6E\x64\x20\x61\x20\x63\x6F\x6E\x66\x69\x67\x75\x72\x65\x64\x20\x53\x4D\x54\x50\x20\x73\x65\x72\x76\x69\x63\x65\x21","\x73\x65\x72\x76\x69\x63\x65","\x53\x6D\x74\x70","\x68\x6F\x73\x74","\x70\x6F\x72\x74","\x73\x65\x63\x75\x72\x65","\x61\x75\x74\x68\x65\x6E\x74\x69\x63\x61\x74\x69\x6F\x6E","\x61\x75\x74\x68","\x70\x61\x73\x73","\x22\x25\x73\x22\x20\x3C\x25\x73\x3E","\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x6D\x65\x72\x67\x65","\x53\x65\x6E\x64\x4D\x61\x69\x6C","\x72\x65\x71\x75\x65\x73\x74","\x4D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74","","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x6C\x6F\x67\x69\x6E","\x6C\x6F\x63\x61\x6C","\x53\x6F\x6D\x65\x74\x68\x69\x6E\x67\x20\x77\x65\x6E\x74\x20\x77\x72\x6F\x6E\x67\x2C\x20\x70\x6C\x65\x61\x73\x65\x20\x74\x72\x79\x20\x61\x67\x61\x69\x6E\x2E","\x6A\x73\x6F\x6E","\x66\x6F\x72\x67\x6F\x74","\x62\x6F\x64\x79","\x45\x6D\x61\x69\x6C\x20\x70\x61\x72\x61\x6D\x65\x74\x65\x72\x20\x69\x73\x20\x6D\x69\x73\x73\x69\x6E\x67","\x67\x65\x6E\x65\x72\x61\x74\x65","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x52\x65\x73\x65\x74\x20\x45\x6D\x61\x69\x6C\x20\x73\x65\x6E\x74\x21","\x78\x43\x61\x6C\x6C\x79\x20\x4D\x6F\x74\x69\x6F\x6E\x20\x50\x61\x73\x73\x77\x6F\x72\x64\x20\x52\x65\x73\x65\x74","\x59\x6F\x75\x20\x61\x72\x65\x20\x72\x65\x63\x65\x69\x76\x69\x6E\x67\x20\x74\x68\x69\x73\x20\x62\x65\x63\x61\x75\x73\x65\x20\x79\x6F\x75\x20\x28\x6F\x72\x20\x73\x6F\x6D\x65\x6F\x6E\x65\x20\x65\x6C\x73\x65\x29\x20\x68\x61\x76\x65\x20\x72\x65\x71\x75\x65\x73\x74\x65\x64\x20\x74\x68\x65\x20\x72\x65\x73\x65\x74\x20\x6F\x66\x20\x74\x68\x65\x20\x70\x61\x73\x73\x77\x6F\x72\x64\x20\x66\x6F\x72\x20\x79\x6F\x75\x72\x20\x61\x63\x63\x6F\x75\x6E\x74\x2E\x0A\x0A","\x50\x6C\x65\x61\x73\x65\x20\x63\x6C\x69\x63\x6B\x20\x6F\x6E\x20\x74\x68\x65\x20\x66\x6F\x6C\x6C\x6F\x77\x69\x6E\x67\x20\x6C\x69\x6E\x6B\x2C\x20\x6F\x72\x20\x70\x61\x73\x74\x65\x20\x74\x68\x69\x73\x20\x69\x6E\x74\x6F\x20\x79\x6F\x75\x72\x20\x62\x72\x6F\x77\x73\x65\x72\x20\x74\x6F\x20\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x74\x68\x65\x20\x70\x72\x6F\x63\x65\x73\x73\x3A\x0A\x0A","\x68\x74\x74\x70\x3A\x2F\x2F","\x68\x65\x61\x64\x65\x72\x73","\x2F\x72\x65\x73\x65\x74\x2F","\x0A\x0A","\x49\x66\x20\x79\x6F\x75\x20\x64\x69\x64\x20\x6E\x6F\x74\x20\x72\x65\x71\x75\x65\x73\x74\x20\x74\x68\x69\x73\x2C\x20\x70\x6C\x65\x61\x73\x65\x20\x69\x67\x6E\x6F\x72\x65\x20\x74\x68\x69\x73\x20\x65\x6D\x61\x69\x6C\x20\x61\x6E\x64\x20\x79\x6F\x75\x72\x20\x70\x61\x73\x73\x77\x6F\x72\x64\x20\x77\x69\x6C\x6C\x20\x72\x65\x6D\x61\x69\x6E\x20\x75\x6E\x63\x68\x61\x6E\x67\x65\x64\x2E\x0A","\x54\x68\x69\x73\x20\x65\x6D\x61\x69\x6C\x20\x69\x73\x20\x6E\x6F\x74\x20\x72\x65\x67\x69\x73\x74\x65\x72\x65\x64\x2E","\x72\x65\x73\x65\x74\x50\x61\x73\x73\x77\x6F\x72\x64\x54\x6F\x6B\x65\x6E","\x72\x65\x73\x65\x74\x50\x61\x73\x73\x77\x6F\x72\x64\x45\x78\x70\x69\x72\x65\x73","\x6E\x6F\x77","\x73\x61\x76\x65","\x72\x65\x73\x65\x74","\x50\x61\x73\x73\x77\x6F\x72\x64\x20\x72\x65\x73\x65\x74\x21","\x50\x61\x73\x73\x77\x6F\x72\x64\x20\x72\x65\x73\x65\x74\x20\x74\x6F\x6B\x65\x6E\x20\x69\x73\x20\x69\x6E\x76\x61\x6C\x69\x64\x20\x6F\x72\x20\x68\x61\x73\x20\x65\x78\x70\x69\x72\x65\x64\x2E","\x70\x61\x73\x73\x77\x6F\x72\x64","\x74\x6F\x6B\x65\x6E","\x70\x61\x72\x61\x6D\x73","\x75\x73\x65"];_0x71ea[0];var util=require(_0x71ea[1]);var passport=require(_0x71ea[2]);var LocalStrategy=require(_0x71ea[4])[_0x71ea[3]];var BPromise=require(_0x71ea[5]);var jayson=require(_0x71ea[6]);var _=require(_0x71ea[7]);var logger=require(_0x71ea[9])(_0x71ea[8]);var rs=require(_0x71ea[10]);var db=require(_0x71ea[12])[_0x71ea[11]];var signToken=require(_0x71ea[14])[_0x71ea[13]];var client=jayson[_0x71ea[16]][_0x71ea[15]]({port:9003});var getLicense=function(_0xa11fxd){return  new BPromise(function(_0xa11fxe,_0xa11fxf){var _0xa11fx10=0;_0xa11fxd[_0x71ea[17]]!== _0x71ea[18]&& _0xa11fxe(_0xa11fxd);return db[_0x71ea[27]][_0x71ea[26]]({where:{role:_0x71ea[18],online:true,id:{$ne:_0xa11fxd[_0x71ea[25]]}}})[_0x71ea[22]](function(_0xa11fx13){_0xa11fx10= _0xa11fx13;return require(_0x71ea[24])[_0x71ea[23]]()})[_0x71ea[22]](function(_0xa11fx12){if(_0xa11fx12&& _0xa11fx12[_0x71ea[20]]&& _0xa11fx10>= _0xa11fx12[_0x71ea[20]]){return _0xa11fxf({message:_0x71ea[21]})};return _0xa11fxe(_0xa11fxd)})[_0x71ea[19]](function(_0xa11fx11){return _0xa11fxf(_0xa11fx11)})})};function localAuthenticate(_0xa11fx15,_0xa11fx16,_0xa11fx17,_0xa11fx18){var _0xa11fx19;_0xa11fx15[_0x71ea[34]]({where:{name:_0xa11fx16[_0x71ea[31]](),role:{$or:[_0x71ea[32],_0x71ea[33],_0x71ea[18]]}}})[_0x71ea[22]](function(_0xa11fxd){if(!_0xa11fxd){return _0xa11fx18(null,false,{message:_0x71ea[30]})};return getLicense(_0xa11fxd)})[_0x71ea[22]](function(_0xa11fxd){_0xa11fxd[_0x71ea[29]](_0xa11fx17,function(_0xa11fx1a,_0xa11fx1b){if(_0xa11fx1a){return _0xa11fx18(_0xa11fx1a)};if(!_0xa11fx1b){return _0xa11fx18(null,false,{message:_0x71ea[28]})}else {return _0xa11fx18(null,_0xa11fxd)}})})[_0x71ea[19]](function(_0xa11fx11){_0xa11fx18(_0xa11fx11)})}function sendServiceMail(_0xa11fx1d){return db[_0x71ea[56]][_0x71ea[34]]({where:{service:true},attributes:[_0x71ea[25],_0x71ea[50],_0x71ea[51]],include:[{model:db[_0x71ea[55]],as:_0x71ea[42]}]})[_0x71ea[22]](function(_0xa11fx1f){if(!_0xa11fx1f){throw  new Error(_0x71ea[40])};var _0xa11fx20={tls:{rejectUnauthorized:false}};if(_0xa11fx1f[_0x71ea[42]][_0x71ea[41]]){_0xa11fx20[_0x71ea[41]]= _0xa11fx1f[_0x71ea[42]][_0x71ea[41]]}else {_0xa11fx20[_0x71ea[43]]= _0xa11fx1f[_0x71ea[42]][_0x71ea[43]];_0xa11fx20[_0x71ea[44]]= _0xa11fx1f[_0x71ea[42]][_0x71ea[44]];_0xa11fx20[_0x71ea[45]]= _0xa11fx1f[_0x71ea[42]][_0x71ea[45]]};if(_0xa11fx1f[_0x71ea[42]][_0x71ea[46]]){_0xa11fx20[_0x71ea[47]]= {user:_0xa11fx1f[_0x71ea[42]][_0x71ea[33]],pass:_0xa11fx1f[_0x71ea[42]][_0x71ea[48]]}};var _0xa11fx21={account:_0xa11fx20,message:_[_0x71ea[52]]({from:util[_0x71ea[39]](_0x71ea[49],_0xa11fx1f[_0x71ea[50]],_0xa11fx1f[_0x71ea[51]]|| _0xa11fx1f[_0x71ea[42]][_0x71ea[33]])},_0xa11fx1d)};return client[_0x71ea[54]](_0x71ea[53],_0xa11fx21)})[_0x71ea[22]](function(_0xa11fx1e){if(_0xa11fx1e[_0x71ea[35]]){throw  new Error(util[_0x71ea[39]](_0x71ea[36],_0xa11fx1e[_0x71ea[35]][_0x71ea[37]]|| JSON[_0x71ea[38]](_0xa11fx1e[_0x71ea[35]])))};return true})}function handleError(_0xa11fx23,_0xa11fx24,_0xa11fx25){return _0xa11fx23[_0x71ea[59]](_0xa11fx24|| 500)[_0x71ea[58]]({message:_0xa11fx25?(_0xa11fx25[_0x71ea[37]]|| _0xa11fx25):_0x71ea[57]})}exports[_0x71ea[60]]= function(_0xa11fx26,_0xa11fx23,_0xa11fx27){passport[_0x71ea[29]](_0x71ea[61],function(_0xa11fx11,_0xa11fxd,_0xa11fx28){var _0xa11fx25=_0xa11fx11|| _0xa11fx28;if(_0xa11fx25){return handleError(_0xa11fx23,401,_0xa11fx25)};if(!_0xa11fxd){return handleError(_0xa11fx23,404,{message:_0x71ea[62]})};var _0xa11fx29=signToken(_0xa11fxd[_0x71ea[25]],_0xa11fxd[_0x71ea[17]]);_0xa11fx23[_0x71ea[63]]({id:_0xa11fxd[_0x71ea[25]],token:_0xa11fx29})})(_0xa11fx26,_0xa11fx23,_0xa11fx27)};exports[_0x71ea[64]]= function(_0xa11fx26,_0xa11fx23,_0xa11fx27){if(!_0xa11fx26[_0x71ea[65]][_0x71ea[51]]){return handleError(_0xa11fx23,500,{message:_0x71ea[66]})};var _0xa11fx29=rs[_0x71ea[67]]();_0xa11fx26[_0x71ea[65]][_0x71ea[51]]= _0xa11fx26[_0x71ea[65]][_0x71ea[51]][_0x71ea[31]]()[_0x71ea[68]]();return db[_0x71ea[27]][_0x71ea[34]]({where:{email:_0xa11fx26[_0x71ea[65]][_0x71ea[51]]}})[_0x71ea[22]](function(_0xa11fxd){if(!_0xa11fxd){throw  new Error(_0x71ea[78])};_0xa11fxd[_0x71ea[79]]= _0xa11fx29;_0xa11fxd[_0x71ea[80]]= Date[_0x71ea[81]]()+ 3600000;return _0xa11fxd[_0x71ea[82]]()})[_0x71ea[22]](function(){return sendServiceMail({to:_0xa11fx26[_0x71ea[65]][_0x71ea[51]],subject:_0x71ea[70],text:_0x71ea[71]+ _0x71ea[72]+ _0x71ea[73]+ _0xa11fx26[_0x71ea[74]][_0x71ea[43]]+ _0x71ea[75]+ _0xa11fx29+ _0x71ea[76]+ _0x71ea[77]})})[_0x71ea[22]](function(){_0xa11fx23[_0x71ea[59]](200)[_0x71ea[58]]({message:_0x71ea[69]})})[_0x71ea[19]](function(_0xa11fx11){return handleError(_0xa11fx23,500,_0xa11fx11)})};exports[_0x71ea[83]]= function(_0xa11fx26,_0xa11fx23,_0xa11fx27){return db[_0x71ea[27]][_0x71ea[34]]({where:{resetPasswordToken:_0xa11fx26[_0x71ea[88]][_0x71ea[87]],resetPasswordExpires:{$gt:Date[_0x71ea[81]]()}}})[_0x71ea[22]](function(_0xa11fxd){if(!_0xa11fxd){throw  new Error(_0x71ea[85])};_0xa11fxd[_0x71ea[86]]= _0xa11fx26[_0x71ea[65]][_0x71ea[86]];_0xa11fxd[_0x71ea[79]]= null;_0xa11fxd[_0x71ea[80]]= null;return _0xa11fxd[_0x71ea[82]]()})[_0x71ea[22]](function(){_0xa11fx23[_0x71ea[59]](200)[_0x71ea[58]]({message:_0x71ea[84]})})[_0x71ea[19]](function(_0xa11fx11){return handleError(_0xa11fx23,500,_0xa11fx11)})};passport[_0x71ea[89]]( new LocalStrategy({usernameField:_0x71ea[50],passwordField:_0x71ea[86]},function(_0xa11fx16,_0xa11fx17,_0xa11fx18){return localAuthenticate(db.User,_0xa11fx16,_0xa11fx17,_0xa11fx18)}))
\ No newline at end of file
+var _0x813e=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x75\x74\x69\x6C","\x70\x61\x73\x73\x70\x6F\x72\x74","\x53\x74\x72\x61\x74\x65\x67\x79","\x70\x61\x73\x73\x70\x6F\x72\x74\x2D\x6C\x6F\x63\x61\x6C","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6A\x61\x79\x73\x6F\x6E\x2F\x70\x72\x6F\x6D\x69\x73\x65","\x6C\x6F\x64\x61\x73\x68","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72","\x72\x61\x6E\x64\x6F\x6D\x73\x74\x72\x69\x6E\x67","\x64\x62","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x79\x73\x71\x6C\x64\x62","\x73\x69\x67\x6E\x54\x6F\x6B\x65\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6D\x70\x6F\x6E\x65\x6E\x74\x73\x2F\x61\x75\x74\x68\x2F\x73\x65\x72\x76\x69\x63\x65","\x68\x74\x74\x70","\x63\x6C\x69\x65\x6E\x74","\x72\x6F\x6C\x65","\x61\x67\x65\x6E\x74","\x63\x61\x74\x63\x68","\x61\x67\x65\x6E\x74\x73","\x4D\x61\x78\x69\x6D\x75\x6D\x20\x6C\x6F\x67\x69\x6E\x20\x68\x61\x73\x20\x62\x65\x65\x6E\x20\x72\x65\x61\x63\x68\x65\x64","\x74\x68\x65\x6E","\x67\x65\x74\x4C\x69\x63\x65\x6E\x73\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x69\x63\x65\x6E\x73\x65\x2F\x75\x74\x69\x6C","\x69\x64","\x63\x6F\x75\x6E\x74","\x55\x73\x65\x72","\x54\x68\x69\x73\x20\x70\x61\x73\x73\x77\x6F\x72\x64\x20\x69\x73\x20\x6E\x6F\x74\x20\x63\x6F\x72\x72\x65\x63\x74\x2E","\x61\x75\x74\x68\x65\x6E\x74\x69\x63\x61\x74\x65","\x54\x68\x69\x73\x20\x6E\x61\x6D\x65\x20\x69\x73\x20\x6E\x6F\x74\x20\x72\x65\x67\x69\x73\x74\x65\x72\x65\x64\x2E","\x74\x72\x69\x6D","\x61\x64\x6D\x69\x6E","\x75\x73\x65\x72","\x66\x69\x6E\x64","\x65\x72\x72\x6F\x72","\x53\x65\x6E\x64\x4D\x61\x69\x6C\x20\x65\x72\x72\x6F\x72\x3A\x20\x25\x73\x2E\x20\x50\x6C\x65\x61\x73\x65\x20\x63\x6F\x6E\x74\x61\x63\x74\x20\x79\x6F\x75\x72\x20\x41\x64\x6D\x69\x6E\x69\x73\x74\x72\x61\x74\x6F\x72\x21","\x6D\x65\x73\x73\x61\x67\x65","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x66\x6F\x72\x6D\x61\x74","\x55\x6E\x61\x62\x6C\x65\x20\x74\x6F\x20\x66\x69\x6E\x64\x20\x61\x20\x63\x6F\x6E\x66\x69\x67\x75\x72\x65\x64\x20\x53\x4D\x54\x50\x20\x73\x65\x72\x76\x69\x63\x65\x21","\x73\x65\x72\x76\x69\x63\x65","\x53\x6D\x74\x70","\x68\x6F\x73\x74","\x70\x6F\x72\x74","\x73\x65\x63\x75\x72\x65","\x61\x75\x74\x68\x65\x6E\x74\x69\x63\x61\x74\x69\x6F\x6E","\x61\x75\x74\x68","\x70\x61\x73\x73","\x22\x25\x73\x22\x20\x3C\x25\x73\x3E","\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x6D\x65\x72\x67\x65","\x53\x65\x6E\x64\x4D\x61\x69\x6C","\x72\x65\x71\x75\x65\x73\x74","\x4D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74","","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x6C\x6F\x67\x69\x6E","\x6C\x6F\x63\x61\x6C","\x53\x6F\x6D\x65\x74\x68\x69\x6E\x67\x20\x77\x65\x6E\x74\x20\x77\x72\x6F\x6E\x67\x2C\x20\x70\x6C\x65\x61\x73\x65\x20\x74\x72\x79\x20\x61\x67\x61\x69\x6E\x2E","\x6A\x73\x6F\x6E","\x66\x6F\x72\x67\x6F\x74","\x62\x6F\x64\x79","\x45\x6D\x61\x69\x6C\x20\x70\x61\x72\x61\x6D\x65\x74\x65\x72\x20\x69\x73\x20\x6D\x69\x73\x73\x69\x6E\x67","\x67\x65\x6E\x65\x72\x61\x74\x65","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x52\x65\x73\x65\x74\x20\x45\x6D\x61\x69\x6C\x20\x73\x65\x6E\x74\x21","\x78\x43\x61\x6C\x6C\x79\x20\x4D\x6F\x74\x69\x6F\x6E\x20\x50\x61\x73\x73\x77\x6F\x72\x64\x20\x52\x65\x73\x65\x74","\x59\x6F\x75\x20\x61\x72\x65\x20\x72\x65\x63\x65\x69\x76\x69\x6E\x67\x20\x74\x68\x69\x73\x20\x62\x65\x63\x61\x75\x73\x65\x20\x79\x6F\x75\x20\x28\x6F\x72\x20\x73\x6F\x6D\x65\x6F\x6E\x65\x20\x65\x6C\x73\x65\x29\x20\x68\x61\x76\x65\x20\x72\x65\x71\x75\x65\x73\x74\x65\x64\x20\x74\x68\x65\x20\x72\x65\x73\x65\x74\x20\x6F\x66\x20\x74\x68\x65\x20\x70\x61\x73\x73\x77\x6F\x72\x64\x20\x66\x6F\x72\x20\x79\x6F\x75\x72\x20\x61\x63\x63\x6F\x75\x6E\x74\x2E\x0A\x0A","\x50\x6C\x65\x61\x73\x65\x20\x63\x6C\x69\x63\x6B\x20\x6F\x6E\x20\x74\x68\x65\x20\x66\x6F\x6C\x6C\x6F\x77\x69\x6E\x67\x20\x6C\x69\x6E\x6B\x2C\x20\x6F\x72\x20\x70\x61\x73\x74\x65\x20\x74\x68\x69\x73\x20\x69\x6E\x74\x6F\x20\x79\x6F\x75\x72\x20\x62\x72\x6F\x77\x73\x65\x72\x20\x74\x6F\x20\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x74\x68\x65\x20\x70\x72\x6F\x63\x65\x73\x73\x3A\x0A\x0A","\x68\x74\x74\x70\x3A\x2F\x2F","\x68\x65\x61\x64\x65\x72\x73","\x2F\x72\x65\x73\x65\x74\x2F","\x0A\x0A","\x49\x66\x20\x79\x6F\x75\x20\x64\x69\x64\x20\x6E\x6F\x74\x20\x72\x65\x71\x75\x65\x73\x74\x20\x74\x68\x69\x73\x2C\x20\x70\x6C\x65\x61\x73\x65\x20\x69\x67\x6E\x6F\x72\x65\x20\x74\x68\x69\x73\x20\x65\x6D\x61\x69\x6C\x20\x61\x6E\x64\x20\x79\x6F\x75\x72\x20\x70\x61\x73\x73\x77\x6F\x72\x64\x20\x77\x69\x6C\x6C\x20\x72\x65\x6D\x61\x69\x6E\x20\x75\x6E\x63\x68\x61\x6E\x67\x65\x64\x2E\x0A","\x54\x68\x69\x73\x20\x65\x6D\x61\x69\x6C\x20\x69\x73\x20\x6E\x6F\x74\x20\x72\x65\x67\x69\x73\x74\x65\x72\x65\x64\x2E","\x72\x65\x73\x65\x74\x50\x61\x73\x73\x77\x6F\x72\x64\x54\x6F\x6B\x65\x6E","\x72\x65\x73\x65\x74\x50\x61\x73\x73\x77\x6F\x72\x64\x45\x78\x70\x69\x72\x65\x73","\x6E\x6F\x77","\x73\x61\x76\x65","\x72\x65\x73\x65\x74","\x50\x61\x73\x73\x77\x6F\x72\x64\x20\x72\x65\x73\x65\x74\x21","\x50\x61\x73\x73\x77\x6F\x72\x64\x20\x72\x65\x73\x65\x74\x20\x74\x6F\x6B\x65\x6E\x20\x69\x73\x20\x69\x6E\x76\x61\x6C\x69\x64\x20\x6F\x72\x20\x68\x61\x73\x20\x65\x78\x70\x69\x72\x65\x64\x2E","\x70\x61\x73\x73\x77\x6F\x72\x64","\x74\x6F\x6B\x65\x6E","\x70\x61\x72\x61\x6D\x73","\x75\x73\x65"];_0x813e[0];var util=require(_0x813e[1]);var passport=require(_0x813e[2]);var LocalStrategy=require(_0x813e[4])[_0x813e[3]];var BPromise=require(_0x813e[5]);var jayson=require(_0x813e[6]);var _=require(_0x813e[7]);var logger=require(_0x813e[9])(_0x813e[8]);var rs=require(_0x813e[10]);var db=require(_0x813e[12])[_0x813e[11]];var signToken=require(_0x813e[14])[_0x813e[13]];var client=jayson[_0x813e[16]][_0x813e[15]]({port:9003});var getLicense=function(_0xd2acxd){return  new BPromise(function(_0xd2acxe,_0xd2acxf){var _0xd2acx10=0;_0xd2acxd[_0x813e[17]]!== _0x813e[18]&& _0xd2acxe(_0xd2acxd);return db[_0x813e[27]][_0x813e[26]]({where:{role:_0x813e[18],online:true,id:{$ne:_0xd2acxd[_0x813e[25]]}}})[_0x813e[22]](function(_0xd2acx13){_0xd2acx10= _0xd2acx13;return require(_0x813e[24])[_0x813e[23]]()})[_0x813e[22]](function(_0xd2acx12){if(_0xd2acx12&& _0xd2acx12[_0x813e[20]]&& _0xd2acx10>= _0xd2acx12[_0x813e[20]]){return _0xd2acxf({message:_0x813e[21]})};return _0xd2acxe(_0xd2acxd)})[_0x813e[19]](function(_0xd2acx11){return _0xd2acxf(_0xd2acx11)})})};function localAuthenticate(_0xd2acx15,_0xd2acx16,_0xd2acx17,_0xd2acx18){var _0xd2acx19;_0xd2acx15[_0x813e[34]]({where:{name:_0xd2acx16[_0x813e[31]](),role:{$or:[_0x813e[32],_0x813e[33],_0x813e[18]]}}})[_0x813e[22]](function(_0xd2acxd){if(!_0xd2acxd){return _0xd2acx18(null,false,{message:_0x813e[30]})};return getLicense(_0xd2acxd)})[_0x813e[22]](function(_0xd2acxd){_0xd2acxd[_0x813e[29]](_0xd2acx17,function(_0xd2acx1a,_0xd2acx1b){if(_0xd2acx1a){return _0xd2acx18(_0xd2acx1a)};if(!_0xd2acx1b){return _0xd2acx18(null,false,{message:_0x813e[28]})}else {return _0xd2acx18(null,_0xd2acxd)}})})[_0x813e[19]](function(_0xd2acx11){_0xd2acx18(_0xd2acx11)})}function sendServiceMail(_0xd2acx1d){return db[_0x813e[56]][_0x813e[34]]({where:{service:true},attributes:[_0x813e[25],_0x813e[50],_0x813e[51]],include:[{model:db[_0x813e[55]],as:_0x813e[42]}]})[_0x813e[22]](function(_0xd2acx1f){if(!_0xd2acx1f){throw  new Error(_0x813e[40])};var _0xd2acx20={tls:{rejectUnauthorized:false}};if(_0xd2acx1f[_0x813e[42]][_0x813e[41]]){_0xd2acx20[_0x813e[41]]= _0xd2acx1f[_0x813e[42]][_0x813e[41]]}else {_0xd2acx20[_0x813e[43]]= _0xd2acx1f[_0x813e[42]][_0x813e[43]];_0xd2acx20[_0x813e[44]]= _0xd2acx1f[_0x813e[42]][_0x813e[44]];_0xd2acx20[_0x813e[45]]= _0xd2acx1f[_0x813e[42]][_0x813e[45]]};if(_0xd2acx1f[_0x813e[42]][_0x813e[46]]){_0xd2acx20[_0x813e[47]]= {user:_0xd2acx1f[_0x813e[42]][_0x813e[33]],pass:_0xd2acx1f[_0x813e[42]][_0x813e[48]]}};var _0xd2acx21={account:_0xd2acx20,message:_[_0x813e[52]]({from:util[_0x813e[39]](_0x813e[49],_0xd2acx1f[_0x813e[50]],_0xd2acx1f[_0x813e[51]]|| _0xd2acx1f[_0x813e[42]][_0x813e[33]])},_0xd2acx1d)};return client[_0x813e[54]](_0x813e[53],_0xd2acx21)})[_0x813e[22]](function(_0xd2acx1e){if(_0xd2acx1e[_0x813e[35]]){throw  new Error(util[_0x813e[39]](_0x813e[36],_0xd2acx1e[_0x813e[35]][_0x813e[37]]|| JSON[_0x813e[38]](_0xd2acx1e[_0x813e[35]])))};return true})}function handleError(_0xd2acx23,_0xd2acx24,_0xd2acx25){return _0xd2acx23[_0x813e[59]](_0xd2acx24|| 500)[_0x813e[58]]({message:_0xd2acx25?(_0xd2acx25[_0x813e[37]]|| _0xd2acx25):_0x813e[57]})}exports[_0x813e[60]]= function(_0xd2acx26,_0xd2acx23,_0xd2acx27){passport[_0x813e[29]](_0x813e[61],function(_0xd2acx11,_0xd2acxd,_0xd2acx28){var _0xd2acx25=_0xd2acx11|| _0xd2acx28;if(_0xd2acx25){return handleError(_0xd2acx23,401,_0xd2acx25)};if(!_0xd2acxd){return handleError(_0xd2acx23,404,{message:_0x813e[62]})};var _0xd2acx29=signToken(_0xd2acxd[_0x813e[25]],_0xd2acxd[_0x813e[17]]);_0xd2acx23[_0x813e[63]]({id:_0xd2acxd[_0x813e[25]],token:_0xd2acx29})})(_0xd2acx26,_0xd2acx23,_0xd2acx27)};exports[_0x813e[64]]= function(_0xd2acx26,_0xd2acx23,_0xd2acx27){if(!_0xd2acx26[_0x813e[65]][_0x813e[51]]){return handleError(_0xd2acx23,500,{message:_0x813e[66]})};var _0xd2acx29=rs[_0x813e[67]]();_0xd2acx26[_0x813e[65]][_0x813e[51]]= _0xd2acx26[_0x813e[65]][_0x813e[51]][_0x813e[31]]()[_0x813e[68]]();return db[_0x813e[27]][_0x813e[34]]({where:{email:_0xd2acx26[_0x813e[65]][_0x813e[51]]}})[_0x813e[22]](function(_0xd2acxd){if(!_0xd2acxd){throw  new Error(_0x813e[78])};_0xd2acxd[_0x813e[79]]= _0xd2acx29;_0xd2acxd[_0x813e[80]]= Date[_0x813e[81]]()+ 3600000;return _0xd2acxd[_0x813e[82]]()})[_0x813e[22]](function(){return sendServiceMail({to:_0xd2acx26[_0x813e[65]][_0x813e[51]],subject:_0x813e[70],text:_0x813e[71]+ _0x813e[72]+ _0x813e[73]+ _0xd2acx26[_0x813e[74]][_0x813e[43]]+ _0x813e[75]+ _0xd2acx29+ _0x813e[76]+ _0x813e[77]})})[_0x813e[22]](function(){_0xd2acx23[_0x813e[59]](200)[_0x813e[58]]({message:_0x813e[69]})})[_0x813e[19]](function(_0xd2acx11){return handleError(_0xd2acx23,500,_0xd2acx11)})};exports[_0x813e[83]]= function(_0xd2acx26,_0xd2acx23,_0xd2acx27){return db[_0x813e[27]][_0x813e[34]]({where:{resetPasswordToken:_0xd2acx26[_0x813e[88]][_0x813e[87]],resetPasswordExpires:{$gt:Date[_0x813e[81]]()}}})[_0x813e[22]](function(_0xd2acxd){if(!_0xd2acxd){throw  new Error(_0x813e[85])};_0xd2acxd[_0x813e[86]]= _0xd2acx26[_0x813e[65]][_0x813e[86]];_0xd2acxd[_0x813e[79]]= null;_0xd2acxd[_0x813e[80]]= null;return _0xd2acxd[_0x813e[82]]()})[_0x813e[22]](function(){_0xd2acx23[_0x813e[59]](200)[_0x813e[58]]({message:_0x813e[84]})})[_0x813e[19]](function(_0xd2acx11){return handleError(_0xd2acx23,500,_0xd2acx11)})};passport[_0x813e[89]]( new LocalStrategy({usernameField:_0x813e[50],passwordField:_0x813e[86]},function(_0xd2acx16,_0xd2acx17,_0xd2acx18){return localAuthenticate(db.User,_0xd2acx16,_0xd2acx17,_0xd2acx18)}))
\ No newline at end of file