-var _0x9da1=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x70\x61\x73\x73\x70\x6F\x72\x74","\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x6A\x73\x6F\x6E\x77\x65\x62\x74\x6F\x6B\x65\x6E","\x65\x78\x70\x72\x65\x73\x73\x2D\x6A\x77\x74","\x63\x6F\x6D\x70\x6F\x73\x61\x62\x6C\x65\x2D\x6D\x69\x64\x64\x6C\x65\x77\x61\x72\x65","\x55\x73\x65\x72","\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x4C\x69\x73\x74","\x73\x65\x63\x72\x65\x74","\x73\x65\x73\x73\x69\x6F\x6E","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6C\x6F\x64\x61\x73\x68","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x75\x73\x65\x72","\x74\x68\x65\x6E","\x69\x64","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65","\x71\x75\x65\x72\x79","\x61\x63\x63\x65\x73\x73\x5F\x74\x6F\x6B\x65\x6E","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x61\x75\x74\x68\x6F\x72\x69\x7A\x61\x74\x69\x6F\x6E","\x68\x65\x61\x64\x65\x72\x73","\x42\x65\x61\x72\x65\x72\x20","\x42\x61\x73\x69\x63","\x73\x74\x61\x72\x74\x73\x57\x69\x74\x68","\x20","\x73\x70\x6C\x69\x74","\x61\x73\x63\x69\x69","\x62\x61\x73\x65\x36\x34","\x3A","\x61\x75\x74\x68\x65\x6E\x74\x69\x63\x61\x74\x65","\x57\x72\x6F\x6E\x67\x20\x63\x72\x65\x64\x65\x6E\x74\x69\x61\x6C\x73\x2E","\x66\x69\x6E\x64\x4F\x6E\x65","\x72\x65\x64\x75\x63\x65","\x72\x6F\x6C\x65","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x68\x61\x73\x4D\x6F\x64\x75\x6C\x65","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x61\x6C\x6C","\x52\x65\x71\x75\x69\x72\x65\x64\x20\x72\x6F\x6C\x65\x20\x6E\x65\x65\x64\x73\x20\x74\x6F\x20\x62\x65\x20\x73\x65\x74","\x69\x6E\x64\x65\x78\x4F\x66","\x75\x73\x65\x72\x52\x6F\x6C\x65\x73","\x31\x64","\x73\x69\x67\x6E","\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","\x74\x6F\x6B\x65\x6E","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x63\x6F\x6F\x6B\x69\x65","\x2F","\x72\x65\x64\x69\x72\x65\x63\x74","\x69\x73\x41\x75\x74\x68\x65\x6E\x74\x69\x63\x61\x74\x65\x64","\x68\x61\x73\x52\x6F\x6C\x65","\x73\x69\x67\x6E\x54\x6F\x6B\x65\x6E","\x73\x65\x74\x54\x6F\x6B\x65\x6E\x43\x6F\x6F\x6B\x69\x65"];_0x9da1[0];var passport=require(_0x9da1[1]);var config=require(_0x9da1[2]);var jwt=require(_0x9da1[3]);var expressJwt=require(_0x9da1[4]);var compose=require(_0x9da1[5]);var User=require(_0x9da1[7])[_0x9da1[6]];var List=require(_0x9da1[7])[_0x9da1[8]];var validateJwt=expressJwt({secret:config[_0x9da1[10]][_0x9da1[9]]});var Promise=require(_0x9da1[11]);var _=require(_0x9da1[12]);function isAuthenticated(){return compose()[_0x9da1[19]](function(_0x7f54xc,_0x7f54xd,_0x7f54xe){if(_0x7f54xc[_0x9da1[20]]&& _0x7f54xc[_0x9da1[20]][_0x9da1[22]](_0x9da1[21])){_0x7f54xc[_0x9da1[24]][_0x9da1[23]]= _0x9da1[25]+ _0x7f54xc[_0x9da1[20]][_0x9da1[21]]};if(_0x7f54xc[_0x9da1[24]]&& _0x7f54xc[_0x9da1[24]][_0x9da1[23]]&& _[_0x9da1[27]](_0x7f54xc[_0x9da1[24]][_0x9da1[23]],_0x9da1[26])){var _0x7f54x11=_[_0x9da1[29]](_0x7f54xc[_0x9da1[24]][_0x9da1[23]],_0x9da1[28]);var _0x7f54x12= new Buffer(_0x7f54x11[1],_0x9da1[31]).toString(_0x9da1[30]);var _0x7f54x13=_[_0x9da1[29]](_0x7f54x12,_0x9da1[32])[0];var _0x7f54x14=_[_0x9da1[29]](_0x7f54x12,_0x9da1[32])[1];return User[_0x9da1[35]]({where:{name:_0x7f54x13}})[_0x9da1[16]](function(_0x7f54x10){if(!_0x7f54x10|| !_0x7f54x10[_0x9da1[33]](_0x7f54x14)){_0x7f54xe( new Error(_0x9da1[34]))};_0x7f54xc[_0x9da1[15]]= {id:_0x7f54x10[_0x9da1[17]]};_0x7f54xe()})}else {validateJwt(_0x7f54xc,_0x7f54xd,_0x7f54xe)}})[_0x9da1[19]](function(_0x7f54xc,_0x7f54xd,_0x7f54xe){User[_0x9da1[18]](_0x7f54xc[_0x9da1[15]][_0x9da1[17]],{include:[{model:List}]})[_0x9da1[16]](function(_0x7f54x10){if(!_0x7f54x10){return _0x7f54xd[_0x9da1[14]](401)};_0x7f54xc[_0x9da1[15]]= _0x7f54x10;return _0x7f54xe()})[_0x9da1[13]](function(_0x7f54xf){return _0x7f54xe(_0x7f54xf)})})}function hasModule(_0x7f54x16,_0x7f54x17){return compose()[_0x9da1[19]](function(_0x7f54xc,_0x7f54xd,_0x7f54xe){return User[_0x9da1[18]](_0x7f54xc[_0x9da1[15]][_0x9da1[17]])[_0x9da1[16]](function(_0x7f54x10){var _0x7f54x1b=[];_0x7f54x16[_0x9da1[41]](function(_0x7f54x1c){_0x7f54x1b[_0x9da1[40]](_0x7f54x10[_0x9da1[39]](_0x7f54x1c))});return Promise[_0x9da1[42]](_0x7f54x1b)})[_0x9da1[16]](function(_0x7f54x18){var hasModule=(_[_0x9da1[36]](_0x7f54x18,function(_0x7f54x19,_0x7f54x1a){return _0x7f54x19|| _0x7f54x1a}));if(_[_0x9da1[38]](_0x7f54x17,_0x7f54xc[_0x9da1[15]][_0x9da1[37]])|| hasModule){return _0x7f54xe()}else {_0x7f54xd[_0x9da1[14]](403)}})[_0x9da1[13]](function(_0x7f54xf){return _0x7f54xe(_0x7f54xf)})})}function hasRole(_0x7f54x1e){if(!_0x7f54x1e){throw new Error(_0x9da1[43])};return compose()[_0x9da1[19]](isAuthenticated())[_0x9da1[19]](function _0x7f54x1f(_0x7f54xc,_0x7f54xd,_0x7f54xe){if(config[_0x9da1[45]][_0x9da1[44]](_0x7f54xc[_0x9da1[15]][_0x9da1[37]])>= config[_0x9da1[45]][_0x9da1[44]](_0x7f54x1e)){return _0x7f54xe()}else {return _0x7f54xd[_0x9da1[14]](403)}})}function signToken(_0x7f54x21,_0x7f54x22,_0x7f54x23){var _0x7f54x24=60* 24* 365* 5;if(!_0x7f54x23){_0x7f54x24= _0x9da1[46]};return jwt[_0x9da1[47]]({id:_0x7f54x21},config[_0x9da1[10]][_0x9da1[9]],{expiresIn:_0x7f54x24})}function setTokenCookie(_0x7f54xc,_0x7f54xd){if(!_0x7f54xc[_0x9da1[15]]){return _0x7f54xd[_0x9da1[49]](404,{message:_0x9da1[48]})};var _0x7f54x26=signToken(_0x7f54xc[_0x9da1[15]][_0x9da1[17]],_0x7f54xc[_0x9da1[15]][_0x9da1[37]]);_0x7f54xd[_0x9da1[52]](_0x9da1[50],JSON[_0x9da1[51]](_0x7f54x26));_0x7f54xd[_0x9da1[54]](_0x9da1[53])}exports[_0x9da1[55]]= isAuthenticated;exports[_0x9da1[56]]= hasRole;exports[_0x9da1[39]]= hasModule;exports[_0x9da1[57]]= signToken;exports[_0x9da1[58]]= setTokenCookie
\ No newline at end of file
+var _0xd4a9=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x70\x61\x73\x73\x70\x6F\x72\x74","\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x6A\x73\x6F\x6E\x77\x65\x62\x74\x6F\x6B\x65\x6E","\x65\x78\x70\x72\x65\x73\x73\x2D\x6A\x77\x74","\x63\x6F\x6D\x70\x6F\x73\x61\x62\x6C\x65\x2D\x6D\x69\x64\x64\x6C\x65\x77\x61\x72\x65","\x55\x73\x65\x72","\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x4C\x69\x73\x74","\x73\x65\x63\x72\x65\x74","\x73\x65\x73\x73\x69\x6F\x6E","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6C\x6F\x64\x61\x73\x68","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x75\x73\x65\x72","\x74\x68\x65\x6E","\x69\x64","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65","\x71\x75\x65\x72\x79","\x61\x63\x63\x65\x73\x73\x5F\x74\x6F\x6B\x65\x6E","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x61\x75\x74\x68\x6F\x72\x69\x7A\x61\x74\x69\x6F\x6E","\x68\x65\x61\x64\x65\x72\x73","\x42\x65\x61\x72\x65\x72\x20","\x42\x61\x73\x69\x63","\x73\x74\x61\x72\x74\x73\x57\x69\x74\x68","\x20","\x73\x70\x6C\x69\x74","\x61\x73\x63\x69\x69","\x62\x61\x73\x65\x36\x34","\x3A","\x61\x75\x74\x68\x65\x6E\x74\x69\x63\x61\x74\x65","\x57\x72\x6F\x6E\x67\x20\x63\x72\x65\x64\x65\x6E\x74\x69\x61\x6C\x73\x2E","\x66\x69\x6E\x64\x4F\x6E\x65","\x72\x65\x64\x75\x63\x65","\x72\x6F\x6C\x65","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x68\x61\x73\x4D\x6F\x64\x75\x6C\x65","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x61\x6C\x6C","\x52\x65\x71\x75\x69\x72\x65\x64\x20\x72\x6F\x6C\x65\x20\x6E\x65\x65\x64\x73\x20\x74\x6F\x20\x62\x65\x20\x73\x65\x74","\x69\x6E\x64\x65\x78\x4F\x66","\x75\x73\x65\x72\x52\x6F\x6C\x65\x73","\x31\x64","\x73\x69\x67\x6E","\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","\x74\x6F\x6B\x65\x6E","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x63\x6F\x6F\x6B\x69\x65","\x2F","\x72\x65\x64\x69\x72\x65\x63\x74","\x69\x73\x41\x75\x74\x68\x65\x6E\x74\x69\x63\x61\x74\x65\x64","\x68\x61\x73\x52\x6F\x6C\x65","\x73\x69\x67\x6E\x54\x6F\x6B\x65\x6E","\x73\x65\x74\x54\x6F\x6B\x65\x6E\x43\x6F\x6F\x6B\x69\x65"];_0xd4a9[0];var passport=require(_0xd4a9[1]);var config=require(_0xd4a9[2]);var jwt=require(_0xd4a9[3]);var expressJwt=require(_0xd4a9[4]);var compose=require(_0xd4a9[5]);var User=require(_0xd4a9[7])[_0xd4a9[6]];var List=require(_0xd4a9[7])[_0xd4a9[8]];var validateJwt=expressJwt({secret:config[_0xd4a9[10]][_0xd4a9[9]]});var Promise=require(_0xd4a9[11]);var _=require(_0xd4a9[12]);function isAuthenticated(){return compose()[_0xd4a9[19]](function(_0xf1c9xc,_0xf1c9xd,_0xf1c9xe){if(_0xf1c9xc[_0xd4a9[20]]&& _0xf1c9xc[_0xd4a9[20]][_0xd4a9[22]](_0xd4a9[21])){_0xf1c9xc[_0xd4a9[24]][_0xd4a9[23]]= _0xd4a9[25]+ _0xf1c9xc[_0xd4a9[20]][_0xd4a9[21]]};if(_0xf1c9xc[_0xd4a9[24]]&& _0xf1c9xc[_0xd4a9[24]][_0xd4a9[23]]&& _[_0xd4a9[27]](_0xf1c9xc[_0xd4a9[24]][_0xd4a9[23]],_0xd4a9[26])){var _0xf1c9x11=_[_0xd4a9[29]](_0xf1c9xc[_0xd4a9[24]][_0xd4a9[23]],_0xd4a9[28]);var _0xf1c9x12= new Buffer(_0xf1c9x11[1],_0xd4a9[31]).toString(_0xd4a9[30]);var _0xf1c9x13=_[_0xd4a9[29]](_0xf1c9x12,_0xd4a9[32])[0];var _0xf1c9x14=_[_0xd4a9[29]](_0xf1c9x12,_0xd4a9[32])[1];return User[_0xd4a9[35]]({where:{name:_0xf1c9x13}})[_0xd4a9[16]](function(_0xf1c9x10){if(!_0xf1c9x10|| !_0xf1c9x10[_0xd4a9[33]](_0xf1c9x14)){_0xf1c9xe( new Error(_0xd4a9[34]))};_0xf1c9xc[_0xd4a9[15]]= {id:_0xf1c9x10[_0xd4a9[17]]};_0xf1c9xe()})}else {validateJwt(_0xf1c9xc,_0xf1c9xd,_0xf1c9xe)}})[_0xd4a9[19]](function(_0xf1c9xc,_0xf1c9xd,_0xf1c9xe){User[_0xd4a9[18]](_0xf1c9xc[_0xd4a9[15]][_0xd4a9[17]],{include:[{model:List}]})[_0xd4a9[16]](function(_0xf1c9x10){if(!_0xf1c9x10){return _0xf1c9xd[_0xd4a9[14]](401)};_0xf1c9xc[_0xd4a9[15]]= _0xf1c9x10;return _0xf1c9xe()})[_0xd4a9[13]](function(_0xf1c9xf){return _0xf1c9xe(_0xf1c9xf)})})}function hasModule(_0xf1c9x16,_0xf1c9x17){return compose()[_0xd4a9[19]](function(_0xf1c9xc,_0xf1c9xd,_0xf1c9xe){return User[_0xd4a9[18]](_0xf1c9xc[_0xd4a9[15]][_0xd4a9[17]])[_0xd4a9[16]](function(_0xf1c9x10){var _0xf1c9x1b=[];_0xf1c9x16[_0xd4a9[41]](function(_0xf1c9x1c){_0xf1c9x1b[_0xd4a9[40]](_0xf1c9x10[_0xd4a9[39]](_0xf1c9x1c))});return Promise[_0xd4a9[42]](_0xf1c9x1b)})[_0xd4a9[16]](function(_0xf1c9x18){var hasModule=(_[_0xd4a9[36]](_0xf1c9x18,function(_0xf1c9x19,_0xf1c9x1a){return _0xf1c9x19|| _0xf1c9x1a}));if(_[_0xd4a9[38]](_0xf1c9x17,_0xf1c9xc[_0xd4a9[15]][_0xd4a9[37]])|| hasModule){return _0xf1c9xe()}else {_0xf1c9xd[_0xd4a9[14]](403)}})[_0xd4a9[13]](function(_0xf1c9xf){return _0xf1c9xe(_0xf1c9xf)})})}function hasRole(_0xf1c9x1e){if(!_0xf1c9x1e){throw new Error(_0xd4a9[43])};return compose()[_0xd4a9[19]](isAuthenticated())[_0xd4a9[19]](function _0xf1c9x1f(_0xf1c9xc,_0xf1c9xd,_0xf1c9xe){if(config[_0xd4a9[45]][_0xd4a9[44]](_0xf1c9xc[_0xd4a9[15]][_0xd4a9[37]])>= config[_0xd4a9[45]][_0xd4a9[44]](_0xf1c9x1e)){return _0xf1c9xe()}else {return _0xf1c9xd[_0xd4a9[14]](403)}})}function signToken(_0xf1c9x21,_0xf1c9x22,_0xf1c9x23){var _0xf1c9x24=60* 24* 365* 5;if(!_0xf1c9x23){_0xf1c9x24= _0xd4a9[46]};return jwt[_0xd4a9[47]]({id:_0xf1c9x21},config[_0xd4a9[10]][_0xd4a9[9]],{expiresIn:_0xf1c9x24})}function setTokenCookie(_0xf1c9xc,_0xf1c9xd){if(!_0xf1c9xc[_0xd4a9[15]]){return _0xf1c9xd[_0xd4a9[49]](404,{message:_0xd4a9[48]})};var _0xf1c9x26=signToken(_0xf1c9xc[_0xd4a9[15]][_0xd4a9[17]],_0xf1c9xc[_0xd4a9[15]][_0xd4a9[37]]);_0xf1c9xd[_0xd4a9[52]](_0xd4a9[50],JSON[_0xd4a9[51]](_0xf1c9x26));_0xf1c9xd[_0xd4a9[54]](_0xd4a9[53])}exports[_0xd4a9[55]]= isAuthenticated;exports[_0xd4a9[56]]= hasRole;exports[_0xd4a9[39]]= hasModule;exports[_0xd4a9[57]]= signToken;exports[_0xd4a9[58]]= setTokenCookie
\ No newline at end of file