Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / api / authGoogle / authGoogle.controller.js
index fe83a0a..cdeed19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a28=['../../config/environment','../../components/auth/service','../../config/utils','login','authenticate','google','/login','email','use','clientID','callbackURL','Setting','allowedLoginAttempts','blockDuration','then','User','find','map','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb'];(function(_0x4f236f,_0xa7cddb){var _0x382543=function(_0x2357a0){while(--_0x2357a0){_0x4f236f['push'](_0x4f236f['shift']());}};_0x382543(++_0xa7cddb);}(_0x8a28,0xfd));var _0x88a2=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x8a28[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x88a2('0x0'));var passport=require(_0x88a2('0x1'));var GoogleStrategy=require(_0x88a2('0x2'))[_0x88a2('0x3')];var moment=require(_0x88a2('0x4'));var db=require(_0x88a2('0x5'))['db'];var config=require(_0x88a2('0x6'));var signToken=require(_0x88a2('0x7'))['signToken'];var utils=require(_0x88a2('0x8'));exports[_0x88a2('0x9')]=passport[_0x88a2('0xa')](_0x88a2('0xb'),{'failureRedirect':_0x88a2('0xc'),'scope':['profile',_0x88a2('0xd')],'session':![]});exports['callback']=passport[_0x88a2('0xa')](_0x88a2('0xb'),{'failureRedirect':_0x88a2('0xc'),'session':![]});passport[_0x88a2('0xe')](new GoogleStrategy({'clientID':config[_0x88a2('0xb')]?config[_0x88a2('0xb')][_0x88a2('0xf')]:'id','clientSecret':config[_0x88a2('0xb')]?config[_0x88a2('0xb')]['clientSecret']:'secret','callbackURL':config[_0x88a2('0xb')]?config[_0x88a2('0xb')][_0x88a2('0x10')]:''},function(_0xae0676,_0x18d477,_0x4887fc,_0x210a52){var _0x1a4056,_0x367a7d;return db[_0x88a2('0x11')]['findOne']({'where':{'id':0x1},'attributes':[_0x88a2('0x12'),_0x88a2('0x13')],'raw':!![]})[_0x88a2('0x14')](function(_0x59801e){_0x1a4056=_0x59801e;return db[_0x88a2('0x15')][_0x88a2('0x16')]({'where':{'email':_[_0x88a2('0x17')](_0x4887fc[_0x88a2('0x18')],_0x88a2('0x19')),'role':{'$or':[_0x88a2('0x1a'),_0x88a2('0x1b'),_0x88a2('0x1c')]}}});})[_0x88a2('0x14')](function(_0x417bf8){_0x367a7d=_0x417bf8;if(_0x367a7d){if(_0x367a7d[_0x88a2('0x1d')]){return _0x210a52(_0x88a2('0x1e'));}else if(_0x1a4056[_0x88a2('0x13')]>0x0){if(_0x367a7d[_0x88a2('0x1f')]){if(moment(_0x367a7d[_0x88a2('0x20')])[_0x88a2('0x21')](_0x1a4056[_0x88a2('0x13')],_0x88a2('0x22'))>moment()){return _0x210a52('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x88a2('0x23')](_0x367a7d,0x0,![],null)[_0x88a2('0x14')](function(){return utils['getLicense'](_0x367a7d);})['then'](function(){return _0x210a52(null,_0x367a7d);});}}else{return utils[_0x88a2('0x24')](_0x367a7d)[_0x88a2('0x14')](function(){return _0x210a52(null,_0x367a7d);});}}else{return utils[_0x88a2('0x24')](_0x367a7d)[_0x88a2('0x14')](function(){return _0x210a52(null,_0x367a7d);});}}return _0x210a52(_0x88a2('0x1e'));})['catch'](function(_0x3b6401){_0x210a52(_0x3b6401);});}));
\ No newline at end of file
+var _0x5b5a=['../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','/login','profile','callback','google','use','clientID','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','User','map','emails','value','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','then','getLicense','catch','passport','passport-google-oauth20','moment'];(function(_0x32edfa,_0x1203d6){var _0x30cfd4=function(_0x3fb741){while(--_0x3fb741){_0x32edfa['push'](_0x32edfa['shift']());}};_0x30cfd4(++_0x1203d6);}(_0x5b5a,0xc3));var _0xa5b5=function(_0xf1a516,_0x4b7594){_0xf1a516=_0xf1a516-0x0;var _0x6792d2=_0x5b5a[_0xf1a516];return _0x6792d2;};'use strict';var _=require('lodash');var passport=require(_0xa5b5('0x0'));var GoogleStrategy=require(_0xa5b5('0x1'))['Strategy'];var moment=require(_0xa5b5('0x2'));var db=require(_0xa5b5('0x3'))['db'];var config=require(_0xa5b5('0x4'));var signToken=require(_0xa5b5('0x5'))[_0xa5b5('0x6')];var utils=require(_0xa5b5('0x7'));exports[_0xa5b5('0x8')]=passport[_0xa5b5('0x9')]('google',{'failureRedirect':_0xa5b5('0xa'),'scope':[_0xa5b5('0xb'),'email'],'session':![]});exports[_0xa5b5('0xc')]=passport[_0xa5b5('0x9')](_0xa5b5('0xd'),{'failureRedirect':_0xa5b5('0xa'),'session':![]});passport[_0xa5b5('0xe')](new GoogleStrategy({'clientID':config[_0xa5b5('0xd')]?config[_0xa5b5('0xd')][_0xa5b5('0xf')]:'id','clientSecret':config[_0xa5b5('0xd')]?config[_0xa5b5('0xd')]['clientSecret']:'secret','callbackURL':config['google']?config['google'][_0xa5b5('0x10')]:''},function(_0x5112b4,_0x3d3574,_0x4f76d8,_0xa4e591){var _0x43c36f,_0x1cce53;return db[_0xa5b5('0x11')][_0xa5b5('0x12')]({'where':{'id':0x1},'attributes':[_0xa5b5('0x13'),_0xa5b5('0x14')],'raw':!![]})['then'](function(_0x521626){_0x43c36f=_0x521626;return db[_0xa5b5('0x15')]['find']({'where':{'email':_[_0xa5b5('0x16')](_0x4f76d8[_0xa5b5('0x17')],_0xa5b5('0x18')),'role':{'$or':['admin','user','agent']}}});})['then'](function(_0x44689a){_0x1cce53=_0x44689a;if(_0x1cce53){if(_0x1cce53[_0xa5b5('0x19')]){return _0xa4e591(_0xa5b5('0x1a'));}else if(_0x43c36f[_0xa5b5('0x14')]>0x0){if(_0x1cce53[_0xa5b5('0x1b')]){if(moment(_0x1cce53[_0xa5b5('0x1c')])['add'](_0x43c36f[_0xa5b5('0x14')],_0xa5b5('0x1d'))>moment()){return _0xa4e591(_0xa5b5('0x1a'));}else{return utils['clearBlockUser'](_0x1cce53,0x0,![],null)[_0xa5b5('0x1e')](function(){return utils[_0xa5b5('0x1f')](_0x1cce53);})[_0xa5b5('0x1e')](function(){return _0xa4e591(null,_0x1cce53);});}}else{return utils[_0xa5b5('0x1f')](_0x1cce53)[_0xa5b5('0x1e')](function(){return _0xa4e591(null,_0x1cce53);});}}else{return utils[_0xa5b5('0x1f')](_0x1cce53)[_0xa5b5('0x1e')](function(){return _0xa4e591(null,_0x1cce53);});}}return _0xa4e591(_0xa5b5('0x1a'));})[_0xa5b5('0x20')](function(_0x2e3599){_0xa4e591(_0x2e3599);});}));
\ No newline at end of file