Built motion from commit (unavailable).|2.5.0
[motion2.git] / server / api / authGoogle / authGoogle.controller.js
index aeab8b8..b277dfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfb2=['disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','clearBlockUser','getLicense','passport','moment','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','login','google','profile','email','callback','authenticate','/login','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find','value','admin','user','agent'];(function(_0x335dcc,_0x574dab){var _0x37cb0e=function(_0x52aae2){while(--_0x52aae2){_0x335dcc['push'](_0x335dcc['shift']());}};_0x37cb0e(++_0x574dab);}(_0xbfb2,0x1f0));var _0x2bfb=function(_0x614c96,_0x41b786){_0x614c96=_0x614c96-0x0;var _0x4b79ea=_0xbfb2[_0x614c96];return _0x4b79ea;};'use strict';var _=require('lodash');var passport=require(_0x2bfb('0x0'));var GoogleStrategy=require('passport-google-oauth20')['Strategy'];var moment=require(_0x2bfb('0x1'));var db=require(_0x2bfb('0x2'))['db'];var config=require(_0x2bfb('0x3'));var signToken=require(_0x2bfb('0x4'))['signToken'];var utils=require(_0x2bfb('0x5'));exports[_0x2bfb('0x6')]=passport['authenticate'](_0x2bfb('0x7'),{'failureRedirect':'/login','scope':[_0x2bfb('0x8'),_0x2bfb('0x9')],'session':![]});exports[_0x2bfb('0xa')]=passport[_0x2bfb('0xb')](_0x2bfb('0x7'),{'failureRedirect':_0x2bfb('0xc'),'session':![]});passport[_0x2bfb('0xd')](new GoogleStrategy({'clientID':config['google']?config[_0x2bfb('0x7')][_0x2bfb('0xe')]:'id','clientSecret':config['google']?config['google'][_0x2bfb('0xf')]:_0x2bfb('0x10'),'callbackURL':config[_0x2bfb('0x7')]?config[_0x2bfb('0x7')][_0x2bfb('0x11')]:''},function(_0x473164,_0x5678b4,_0xa24dca,_0x333146){var _0x2ae101,_0x44e442;return db[_0x2bfb('0x12')][_0x2bfb('0x13')]({'where':{'id':0x1},'attributes':[_0x2bfb('0x14'),_0x2bfb('0x15')],'raw':!![]})[_0x2bfb('0x16')](function(_0x3b95fb){_0x2ae101=_0x3b95fb;return db[_0x2bfb('0x17')][_0x2bfb('0x18')]({'where':{'email':_['map'](_0xa24dca['emails'],_0x2bfb('0x19')),'role':{'$or':[_0x2bfb('0x1a'),_0x2bfb('0x1b'),_0x2bfb('0x1c')]}}});})[_0x2bfb('0x16')](function(_0x3a0151){_0x44e442=_0x3a0151;if(_0x44e442){if(_0x44e442[_0x2bfb('0x1d')]){return _0x333146(_0x2bfb('0x1e'));}else if(_0x2ae101[_0x2bfb('0x15')]>0x0){if(_0x44e442[_0x2bfb('0x1f')]){if(moment(_0x44e442['blockedAt'])[_0x2bfb('0x20')](_0x2ae101[_0x2bfb('0x15')],'minutes')>moment()){return _0x333146(_0x2bfb('0x1e'));}else{return utils[_0x2bfb('0x21')](_0x44e442,0x0,![],null)[_0x2bfb('0x16')](function(){return utils[_0x2bfb('0x22')](_0x44e442);})[_0x2bfb('0x16')](function(){return _0x333146(null,_0x44e442);});}}else{return utils[_0x2bfb('0x22')](_0x44e442)[_0x2bfb('0x16')](function(){return _0x333146(null,_0x44e442);});}}else{return utils[_0x2bfb('0x22')](_0x44e442)[_0x2bfb('0x16')](function(){return _0x333146(null,_0x44e442);});}}return _0x333146('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})['catch'](function(_0x260fbb){_0x333146(_0x260fbb);});}));
\ No newline at end of file
+var _0x84ab=['catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/environment','signToken','../../config/utils','authenticate','google','profile','email','callback','/login','use','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','then','User','map','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','clearBlockUser','getLicense'];(function(_0x5b9c76,_0x4fc91b){var _0x33793b=function(_0x2b7589){while(--_0x2b7589){_0x5b9c76['push'](_0x5b9c76['shift']());}};_0x33793b(++_0x4fc91b);}(_0x84ab,0x1eb));var _0xb84a=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x84ab[_0x5c2c7c];return _0xea7ffe;};'use strict';var _=require(_0xb84a('0x0'));var passport=require(_0xb84a('0x1'));var GoogleStrategy=require(_0xb84a('0x2'))['Strategy'];var moment=require(_0xb84a('0x3'));var db=require(_0xb84a('0x4'))['db'];var config=require(_0xb84a('0x5'));var signToken=require('../../components/auth/service')[_0xb84a('0x6')];var utils=require(_0xb84a('0x7'));exports['login']=passport[_0xb84a('0x8')](_0xb84a('0x9'),{'failureRedirect':'/login','scope':[_0xb84a('0xa'),_0xb84a('0xb')],'session':![]});exports[_0xb84a('0xc')]=passport[_0xb84a('0x8')](_0xb84a('0x9'),{'failureRedirect':_0xb84a('0xd'),'session':![]});passport[_0xb84a('0xe')](new GoogleStrategy({'clientID':config[_0xb84a('0x9')]?config[_0xb84a('0x9')]['clientID']:'id','clientSecret':config[_0xb84a('0x9')]?config[_0xb84a('0x9')][_0xb84a('0xf')]:_0xb84a('0x10'),'callbackURL':config[_0xb84a('0x9')]?config[_0xb84a('0x9')][_0xb84a('0x11')]:''},function(_0x2a2700,_0x42a78d,_0x4a819a,_0x8bca7){var _0x542d83,_0x30e380;return db[_0xb84a('0x12')][_0xb84a('0x13')]({'where':{'id':0x1},'attributes':[_0xb84a('0x14'),'blockDuration'],'raw':!![]})[_0xb84a('0x15')](function(_0x13901e){_0x542d83=_0x13901e;return db[_0xb84a('0x16')]['find']({'where':{'email':_[_0xb84a('0x17')](_0x4a819a['emails'],_0xb84a('0x18')),'role':{'$or':[_0xb84a('0x19'),_0xb84a('0x1a'),_0xb84a('0x1b')]}}});})[_0xb84a('0x15')](function(_0x162916){_0x30e380=_0x162916;if(_0x30e380){if(_0x30e380[_0xb84a('0x1c')]){return _0x8bca7(_0xb84a('0x1d'));}else if(_0x542d83['blockDuration']>0x0){if(_0x30e380['blocked']){if(moment(_0x30e380[_0xb84a('0x1e')])[_0xb84a('0x1f')](_0x542d83['blockDuration'],'minutes')>moment()){return _0x8bca7(_0xb84a('0x1d'));}else{return utils[_0xb84a('0x20')](_0x30e380,0x0,![],null)[_0xb84a('0x15')](function(){return utils[_0xb84a('0x21')](_0x30e380);})[_0xb84a('0x15')](function(){return _0x8bca7(null,_0x30e380);});}}else{return utils[_0xb84a('0x21')](_0x30e380)[_0xb84a('0x15')](function(){return _0x8bca7(null,_0x30e380);});}}else{return utils[_0xb84a('0x21')](_0x30e380)[_0xb84a('0x15')](function(){return _0x8bca7(null,_0x30e380);});}}return _0x8bca7(_0xb84a('0x1d'));})[_0xb84a('0x22')](function(_0x2e8c31){_0x8bca7(_0x2e8c31);});}));
\ No newline at end of file