Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / api / user / user.model.js
index 5e446c7..6907893 100644 (file)
@@ -1 +1 @@
-'use strict';const a777_0x3584=['makeSalt','md5secret','salt',':asterisk:','updateMd5Password','1867ZvRMpO','47RyUIMI','pbkdf2','1XNvLWh','password','function','sha1','google','./user.options','md5','exports','from','805121mTNHun','sequelize','toString','850044aKwyYe','4271TilNXv','updatePassword','28201uDsSzF','makeSaltAsync','encryptPassword','Missing\x20Callback','pbkdf2Sync','base64','930613WdVzRv','201705meubnF','./user.attributes','8lSyGsm','54Xhpnkt','init','crypto','randomBytes','local','isEmpty'];const a777_0x230e=function(_0x418e3a,_0x295f3f){_0x418e3a=_0x418e3a-0x12a;let _0x358450=a777_0x3584[_0x418e3a];return _0x358450;};const a777_0x2a3b65=a777_0x230e;(function(_0x5cfb81,_0x5a6ed0){const _0x3b23f5=a777_0x230e;while(!![]){try{const _0x10ceaf=parseInt(_0x3b23f5(0x147))+-parseInt(_0x3b23f5(0x141))*parseInt(_0x3b23f5(0x14a))+parseInt(_0x3b23f5(0x12f))*-parseInt(_0x3b23f5(0x14b))+-parseInt(_0x3b23f5(0x130))*-parseInt(_0x3b23f5(0x13f))+parseInt(_0x3b23f5(0x13e))+-parseInt(_0x3b23f5(0x132))*parseInt(_0x3b23f5(0x13b))+-parseInt(_0x3b23f5(0x148));if(_0x10ceaf===_0x5a6ed0)break;else _0x5cfb81['push'](_0x5cfb81['shift']());}catch(_0x29e7ed){_0x5cfb81['push'](_0x5cfb81['shift']());}}}(a777_0x3584,0x9e3ce));const {Model}=require(a777_0x2a3b65(0x13c)),{attributes}=require(a777_0x2a3b65(0x149)),{options}=require(a777_0x2a3b65(0x137)),crypto=require(a777_0x2a3b65(0x14d)),md5=require(a777_0x2a3b65(0x138)),_=require('lodash'),authTypes=[a777_0x2a3b65(0x136),a777_0x2a3b65(0x14f)];class User extends Model{['authenticate'](_0x554067,_0x22b81f){const _0x44b7a1=a777_0x2a3b65;if(!_0x22b81f)return this['password']===this[_0x44b7a1(0x143)](_0x554067);this['encryptPassword'](_0x554067,(_0x3007a8,_0x4e2bb7)=>{const _0xd4c35a=_0x44b7a1;_0x3007a8&&_0x22b81f(_0x3007a8),this[_0xd4c35a(0x133)]===_0x4e2bb7?_0x22b81f(null,!![]):_0x22b81f(null,![]);});}[a777_0x2a3b65(0x12a)](_0x3d734b,_0x42e6d1){const _0xc231d0=a777_0x2a3b65,_0x461de3=0x10;if(typeof arguments[0x0]===_0xc231d0(0x134))_0x42e6d1=arguments[0x0],_0x3d734b=_0x461de3;else{if(typeof arguments[0x1]===_0xc231d0(0x134))_0x42e6d1=arguments[0x1];else throw new Error(_0xc231d0(0x144));}!_0x3d734b&&(_0x3d734b=_0x461de3);try{const _0x1248f9=crypto[_0xc231d0(0x14e)](_0x3d734b),_0x2208db=_0x1248f9[_0xc231d0(0x13d)](_0xc231d0(0x146));return _0x42e6d1(null,_0x2208db),_0x2208db;}catch(_0x3787eb){_0x42e6d1(_0x3787eb);throw _0x3787eb;}}async[a777_0x2a3b65(0x142)](_0x593a1a=0x10){return new Promise((_0x92078d,_0x1a6aa5)=>{const _0x43da8c=a777_0x230e;crypto[_0x43da8c(0x14e)](_0x593a1a,function(_0x41abe5,_0x568e37){const _0x9e1f90=_0x43da8c;_0x41abe5&&_0x1a6aa5(_0x41abe5),_0x92078d(_0x568e37[_0x9e1f90(0x13d)]('base64'));});});}['encryptPassword'](_0x441a8f,_0x122778){const _0x547864=a777_0x2a3b65;if(!_0x441a8f||!this[_0x547864(0x12c)])return _0x122778&&_0x122778(null),null;const _0x4bebee=0x2710,_0x3c677b=0x40,_0x5db8ac=Buffer[_0x547864(0x13a)](this[_0x547864(0x12c)],_0x547864(0x146));if(!_0x122778)return crypto[_0x547864(0x145)](_0x441a8f,_0x5db8ac,_0x4bebee,_0x3c677b,_0x547864(0x135))['toString']('base64');try{crypto[_0x547864(0x131)](_0x441a8f,_0x5db8ac,_0x4bebee,_0x3c677b,_0x547864(0x135),(_0x2ac53b,_0x295e74)=>{const _0x93f901=_0x547864;_0x2ac53b?_0x122778(_0x2ac53b):_0x122778(null,_0x295e74[_0x93f901(0x13d)](_0x93f901(0x146)));});}catch(_0x4d4952){_0x122778&&_0x122778(_0x4d4952);throw _0x4d4952;}}async[a777_0x2a3b65(0x140)](){const _0x21108f=a777_0x2a3b65;if(!this['password'])return null;if(!_[_0x21108f(0x150)](this[_0x21108f(0x133)])&&authTypes['indexOf'](this['provider'])===-0x1)throw new Error('Invalid\x20password');return this[_0x21108f(0x12c)]=await this[_0x21108f(0x142)](),new Promise((_0x9fba1a,_0x37d405)=>{const _0x3e639d=_0x21108f;this[_0x3e639d(0x143)](this[_0x3e639d(0x133)],(_0x537e85,_0x471a57)=>{const _0x233404=_0x3e639d;_0x537e85?_0x37d405(_0x537e85):(this[_0x233404(0x133)]=_0x471a57,_0x9fba1a());});});}[a777_0x2a3b65(0x12e)](){const _0x19678b=a777_0x2a3b65;return this[_0x19678b(0x12b)]=md5(this['name']+_0x19678b(0x12d)+this[_0x19678b(0x133)]),this['md5secret'];}}function init(_0x1a4810,_0x12c293){const _0x55b48e=a777_0x2a3b65,_0x31fc76=options(_0x1a4810),_0x1861fb=typeof _0x12c293===_0x55b48e(0x134)?_0x12c293(_0x31fc76):_0x31fc76;return User[_0x55b48e(0x14c)](attributes,_0x1861fb),User;}module['exports']['User']=User,module[a777_0x2a3b65(0x139)][a777_0x2a3b65(0x14c)]=init;
\ No newline at end of file
+'use strict';const a773_0x1f37=['function','crypto','authenticate','updateMd5Password','58199UELzon','google','exports','lodash','encryptPassword',':asterisk:','indexOf','sha1','220700HPFzrO','18QiSYyD','base64','local','salt','md5','1epbVgK','toString','password','290573VEVTEK','provider','md5secret','Invalid\x20password','updatePassword','name','Missing\x20Callback','224078vEGUfB','129739GMvtSy','./user.options','sequelize','from','init','1pomtoO','randomBytes','pbkdf2Sync','56890yqWxDM','makeSaltAsync','195473wBSRgy','User','pbkdf2'];const a773_0x4672=function(_0x48534d,_0x2aa690){_0x48534d=_0x48534d-0x106;let _0x1f37cb=a773_0x1f37[_0x48534d];return _0x1f37cb;};const a773_0xa3632d=a773_0x4672;(function(_0x5a1947,_0x16626c){const _0x20ea8d=a773_0x4672;while(!![]){try{const _0x49b404=parseInt(_0x20ea8d(0x10e))*-parseInt(_0x20ea8d(0x11c))+-parseInt(_0x20ea8d(0x116))+-parseInt(_0x20ea8d(0x12c))*parseInt(_0x20ea8d(0x107))+parseInt(_0x20ea8d(0x127))+-parseInt(_0x20ea8d(0x126))+-parseInt(_0x20ea8d(0x11f))+parseInt(_0x20ea8d(0x117))*parseInt(_0x20ea8d(0x12f));if(_0x49b404===_0x16626c)break;else _0x5a1947['push'](_0x5a1947['shift']());}catch(_0x320c88){_0x5a1947['push'](_0x5a1947['shift']());}}}(a773_0x1f37,0x28380));const {Model}=require(a773_0xa3632d(0x129)),{attributes}=require('./user.attributes'),{options}=require(a773_0xa3632d(0x128)),crypto=require(a773_0xa3632d(0x10b)),md5=require(a773_0xa3632d(0x11b)),_=require(a773_0xa3632d(0x111)),authTypes=[a773_0xa3632d(0x10f),a773_0xa3632d(0x119)];class User extends Model{[a773_0xa3632d(0x10c)](_0x19b83c,_0x428c6d){const _0x274b04=a773_0xa3632d;if(!_0x428c6d)return this['password']===this[_0x274b04(0x112)](_0x19b83c);this[_0x274b04(0x112)](_0x19b83c,(_0x251051,_0xda06cf)=>{const _0x5e1843=_0x274b04;_0x251051&&_0x428c6d(_0x251051),this[_0x5e1843(0x11e)]===_0xda06cf?_0x428c6d(null,!![]):_0x428c6d(null,![]);});}['makeSalt'](_0x29357d,_0x5818a7){const _0x8fd50d=a773_0xa3632d,_0x52e4e1=0x10;if(typeof arguments[0x0]==='function')_0x5818a7=arguments[0x0],_0x29357d=_0x52e4e1;else{if(typeof arguments[0x1]===_0x8fd50d(0x10a))_0x5818a7=arguments[0x1];else throw new Error(_0x8fd50d(0x125));}!_0x29357d&&(_0x29357d=_0x52e4e1);try{const _0xa4b78a=crypto['randomBytes'](_0x29357d),_0x1818f3=_0xa4b78a[_0x8fd50d(0x11d)](_0x8fd50d(0x118));return _0x5818a7(null,_0x1818f3),_0x1818f3;}catch(_0x1137c8){_0x5818a7(_0x1137c8);throw _0x1137c8;}}async[a773_0xa3632d(0x106)](_0x4e3a8b=0x10){return new Promise((_0x171d4e,_0x29f03e)=>{const _0x2b0a9f=a773_0x4672;crypto[_0x2b0a9f(0x12d)](_0x4e3a8b,function(_0x244462,_0x1f279b){const _0x2b8aed=_0x2b0a9f;_0x244462&&_0x29f03e(_0x244462),_0x171d4e(_0x1f279b['toString'](_0x2b8aed(0x118)));});});}[a773_0xa3632d(0x112)](_0x39da74,_0x14c140){const _0x4fe4db=a773_0xa3632d;if(!_0x39da74||!this[_0x4fe4db(0x11a)])return _0x14c140&&_0x14c140(null),null;const _0x4e04d5=0x2710,_0x807f64=0x40,_0x2973c0=Buffer[_0x4fe4db(0x12a)](this[_0x4fe4db(0x11a)],'base64');if(!_0x14c140)return crypto[_0x4fe4db(0x12e)](_0x39da74,_0x2973c0,_0x4e04d5,_0x807f64,_0x4fe4db(0x115))[_0x4fe4db(0x11d)](_0x4fe4db(0x118));try{crypto[_0x4fe4db(0x109)](_0x39da74,_0x2973c0,_0x4e04d5,_0x807f64,_0x4fe4db(0x115),(_0x2d7dc7,_0x298102)=>{const _0x27db35=_0x4fe4db;_0x2d7dc7?_0x14c140(_0x2d7dc7):_0x14c140(null,_0x298102[_0x27db35(0x11d)](_0x27db35(0x118)));});}catch(_0x4b8bd8){_0x14c140&&_0x14c140(_0x4b8bd8);throw _0x4b8bd8;}}async[a773_0xa3632d(0x123)](){const _0x182d8c=a773_0xa3632d;if(!this[_0x182d8c(0x11e)])return null;if(!_['isEmpty'](this['password'])&&authTypes[_0x182d8c(0x114)](this[_0x182d8c(0x120)])===-0x1)throw new Error(_0x182d8c(0x122));return this[_0x182d8c(0x11a)]=await this[_0x182d8c(0x106)](),new Promise((_0x4a21ad,_0x2ffafe)=>{const _0x2cb159=_0x182d8c;this[_0x2cb159(0x112)](this[_0x2cb159(0x11e)],(_0x2bd0b8,_0x716282)=>{const _0x1a585a=_0x2cb159;_0x2bd0b8?_0x2ffafe(_0x2bd0b8):(this[_0x1a585a(0x11e)]=_0x716282,_0x4a21ad());});});}[a773_0xa3632d(0x10d)](){const _0x878d43=a773_0xa3632d;return this[_0x878d43(0x121)]=md5(this[_0x878d43(0x124)]+_0x878d43(0x113)+this[_0x878d43(0x11e)]),this[_0x878d43(0x121)];}}function init(_0x2a27cb,_0xf15f38){const _0x3c8788=a773_0xa3632d,_0x18732f=options(_0x2a27cb),_0x3645cf=typeof _0xf15f38===_0x3c8788(0x10a)?_0xf15f38(_0x18732f):_0x18732f;return User['init'](attributes,_0x3645cf),User;}module[a773_0xa3632d(0x110)][a773_0xa3632d(0x108)]=User,module[a773_0xa3632d(0x110)][a773_0xa3632d(0x12b)]=init;
\ No newline at end of file