Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / api / authGoogle / authGoogle.controller.js
index 7955aa2..9a3539f 100644 (file)
@@ -1 +1 @@
-'use strict';const a41_0x228f=['value','callback','@mysqldb','passport','1428900qxsueN','catch','callbackURL','authenticate','login','/login','profile','moment','blocked','clientSecret','Setting','allowedLoginAttempts','456459mBSzXp','emails','1WmIxnE','user','secret','968519aDfrQd','User','lodash','blockDuration','getLicense','1190869cQwvKF','@config/utils','Strategy','then','@config/environment','3THLfml','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clientID','blockedAt','1382261TmKYnv','google','2299895PBhSuf','clearBlockUser','sequelize','484501kXxxqY','1juJSRg','map','admin','findOne'];const a41_0x4361=function(_0x36c534,_0x46b447){_0x36c534=_0x36c534-0x9a;let _0x228f1f=a41_0x228f[_0x36c534];return _0x228f1f;};const a41_0x54935f=a41_0x4361;(function(_0x43ed12,_0x5cfb23){const _0x592b74=a41_0x4361;while(!![]){try{const _0x5ca6f8=-parseInt(_0x592b74(0xb6))+parseInt(_0x592b74(0xac))+parseInt(_0x592b74(0xb1))*parseInt(_0x592b74(0xa2))+-parseInt(_0x592b74(0xbb))*parseInt(_0x592b74(0xbc))+parseInt(_0x592b74(0xa4))*parseInt(_0x592b74(0xa7))+parseInt(_0x592b74(0xc4))+-parseInt(_0x592b74(0xb8));if(_0x5ca6f8===_0x5cfb23)break;else _0x43ed12['push'](_0x43ed12['shift']());}catch(_0x2e7acb){_0x43ed12['push'](_0x43ed12['shift']());}}}(a41_0x228f,0xc11e0));const _=require(a41_0x54935f(0xa9)),passport=require(a41_0x54935f(0xc3)),GoogleStrategy=require('passport-google-oauth20')[a41_0x54935f(0xae)],moment=require(a41_0x54935f(0x9d)),{db}=require(a41_0x54935f(0xc2)),config=require(a41_0x54935f(0xb0)),utils=require(a41_0x54935f(0xad)),{Op}=require(a41_0x54935f(0xba));exports[a41_0x54935f(0x9a)]=passport[a41_0x54935f(0xc7)]('google',{'failureRedirect':'/login','scope':[a41_0x54935f(0x9c),'email'],'session':![]}),exports[a41_0x54935f(0xc1)]=passport[a41_0x54935f(0xc7)](a41_0x54935f(0xb7),{'failureRedirect':a41_0x54935f(0x9b),'session':![]}),passport['use'](new GoogleStrategy({'clientID':config['google']?config[a41_0x54935f(0xb7)][a41_0x54935f(0xb4)]:'id','clientSecret':config[a41_0x54935f(0xb7)]?config[a41_0x54935f(0xb7)][a41_0x54935f(0x9f)]:a41_0x54935f(0xa6),'callbackURL':config[a41_0x54935f(0xb7)]?config['google'][a41_0x54935f(0xc6)]:''},function(_0x2e3763,_0xd9e4f9,_0x46cc74,_0x5e0c82){const _0x3d93d4=a41_0x54935f;let _0x24b522,_0x205901;return db[_0x3d93d4(0xa0)][_0x3d93d4(0xbf)]({'where':{'id':0x1},'attributes':[_0x3d93d4(0xa1),_0x3d93d4(0xaa)],'raw':!![]})['then'](function(_0x4623ae){const _0x3739ca=_0x3d93d4;return _0x24b522=_0x4623ae,db[_0x3739ca(0xa8)][_0x3739ca(0xbf)]({'where':{'email':_[_0x3739ca(0xbd)](_0x46cc74[_0x3739ca(0xa3)],_0x3739ca(0xc0)),'role':{[Op['or']]:[_0x3739ca(0xbe),_0x3739ca(0xa5),'agent']}}});})[_0x3d93d4(0xaf)](function(_0x16b7c5){const _0x42e436=_0x3d93d4;_0x205901=_0x16b7c5;if(_0x205901){if(_0x205901[_0x42e436(0xb2)])return _0x5e0c82('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');else return _0x24b522[_0x42e436(0xaa)]>0x0?_0x205901[_0x42e436(0x9e)]?moment(_0x205901[_0x42e436(0xb5)])['add'](_0x24b522[_0x42e436(0xaa)],'minutes')>moment()?_0x5e0c82(_0x42e436(0xb3)):utils[_0x42e436(0xb9)](_0x205901,0x0,![],null)['then'](function(){const _0x477f3a=_0x42e436;return utils[_0x477f3a(0xab)](_0x205901);})['then'](function(){return _0x5e0c82(null,_0x205901);}):utils['getLicense'](_0x205901)[_0x42e436(0xaf)](function(){return _0x5e0c82(null,_0x205901);}):utils['getLicense'](_0x205901)[_0x42e436(0xaf)](function(){return _0x5e0c82(null,_0x205901);});}return _0x5e0c82(_0x42e436(0xb3));})[_0x3d93d4(0xc5)](function(_0x3dddf6){_0x5e0c82(_0x3dddf6);});}));
\ No newline at end of file
+'use strict';const a41_0x53bf=['google','admin','@mysqldb','140408avzwnd','passport-google-oauth20','findOne','catch','emails','@config/utils','getLicense','447933CtOnBm','sequelize','clearBlockUser','passport','1URBRPN','User','value','then','@config/get-config','minutes','profile','callback','4EztizW','4uvdccO','googleId','blockDuration','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','1DuhVOY','domain','/api/auth/google/callback','login','453025hXIfVh','user','blocked','googleSecret','lodash','70303UEAAhU','247618THbDid','agent','Strategy','blockedAt','882442NBEQyL','94011NXMwRg','allowedLoginAttempts','moment','authenticate','use'];const a41_0x1e42=function(_0x212205,_0x52e8dd){_0x212205=_0x212205-0x1ce;let _0x53bfdb=a41_0x53bf[_0x212205];return _0x53bfdb;};const a41_0x27ce70=a41_0x1e42;(function(_0x2bfffa,_0xdf3f21){const _0x359683=a41_0x1e42;while(!![]){try{const _0x1fee39=-parseInt(_0x359683(0x1df))*-parseInt(_0x359683(0x1f2))+-parseInt(_0x359683(0x1d6))*-parseInt(_0x359683(0x1fa))+parseInt(_0x359683(0x1ec))*parseInt(_0x359683(0x1de))+parseInt(_0x359683(0x1f1))+-parseInt(_0x359683(0x1e3))*parseInt(_0x359683(0x1e7))+-parseInt(_0x359683(0x1d2))+-parseInt(_0x359683(0x1ed));if(_0x1fee39===_0xdf3f21)break;else _0x2bfffa['push'](_0x2bfffa['shift']());}catch(_0x3d8f83){_0x2bfffa['push'](_0x2bfffa['shift']());}}}(a41_0x53bf,0x81c4a));const _=require(a41_0x27ce70(0x1eb)),passport=require(a41_0x27ce70(0x1d5)),GoogleStrategy=require(a41_0x27ce70(0x1fb))[a41_0x27ce70(0x1ef)],moment=require(a41_0x27ce70(0x1f4)),{db}=require(a41_0x27ce70(0x1f9)),{getConfig}=require(a41_0x27ce70(0x1da)),config=getConfig(),utils=require(a41_0x27ce70(0x1d0)),{Op}=require(a41_0x27ce70(0x1d3));exports[a41_0x27ce70(0x1e6)]=passport[a41_0x27ce70(0x1f5)](a41_0x27ce70(0x1f7),{'failureRedirect':'/login','scope':[a41_0x27ce70(0x1dc),'email'],'session':![]}),exports[a41_0x27ce70(0x1dd)]=passport[a41_0x27ce70(0x1f5)]('google',{'failureRedirect':'/login','session':![]}),passport[a41_0x27ce70(0x1f6)](new GoogleStrategy({'clientID':config[a41_0x27ce70(0x1e0)],'clientSecret':config[a41_0x27ce70(0x1ea)],'callbackURL':new URL(a41_0x27ce70(0x1e5),config[a41_0x27ce70(0x1e4)])['href']},function(_0x2811c1,_0x41e98b,_0x37297e,_0x2f27b1){const _0x328523=a41_0x27ce70;let _0x10ed5a,_0x350253;return db['Setting'][_0x328523(0x1fc)]({'where':{'id':0x1},'attributes':[_0x328523(0x1f3),_0x328523(0x1e1)],'raw':!![]})[_0x328523(0x1d9)](function(_0x5b0be1){const _0x19210c=_0x328523;return _0x10ed5a=_0x5b0be1,db[_0x19210c(0x1d7)]['findOne']({'where':{'email':_['map'](_0x37297e[_0x19210c(0x1cf)],_0x19210c(0x1d8)),'role':{[Op['or']]:[_0x19210c(0x1f8),_0x19210c(0x1e8),_0x19210c(0x1ee)]}}});})['then'](function(_0x1cd088){const _0x4c2977=_0x328523;_0x350253=_0x1cd088;if(_0x350253){if(_0x350253['disabled'])return _0x2f27b1(_0x4c2977(0x1e2));else return _0x10ed5a[_0x4c2977(0x1e1)]>0x0?_0x350253[_0x4c2977(0x1e9)]?moment(_0x350253[_0x4c2977(0x1f0)])['add'](_0x10ed5a[_0x4c2977(0x1e1)],_0x4c2977(0x1db))>moment()?_0x2f27b1(_0x4c2977(0x1e2)):utils[_0x4c2977(0x1d4)](_0x350253,0x0,![],null)[_0x4c2977(0x1d9)](function(){const _0x2415d2=_0x4c2977;return utils[_0x2415d2(0x1d1)](_0x350253);})[_0x4c2977(0x1d9)](function(){return _0x2f27b1(null,_0x350253);}):utils['getLicense'](_0x350253)[_0x4c2977(0x1d9)](function(){return _0x2f27b1(null,_0x350253);}):utils[_0x4c2977(0x1d1)](_0x350253)['then'](function(){return _0x2f27b1(null,_0x350253);});}return _0x2f27b1(_0x4c2977(0x1e2));})[_0x328523(0x1ce)](function(_0x52afed){_0x2f27b1(_0x52afed);});}));
\ No newline at end of file