Built motion from commit (unavailable).|2.0.70
[motion2.git] / server / api / authGoogle / authGoogle.controller.js
index f8c3c82..360f2e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b43=['catch','lodash','Strategy','../../mysqldb','../../components/auth/service','login','authenticate','google','profile','email','callback','/login','use','clientID','secret','callbackURL','User','map','emails','value','user','agent','User\x20email\x20not\x20found!'];(function(_0x29ebfc,_0x256ebc){var _0x4ede2f=function(_0x1a5590){while(--_0x1a5590){_0x29ebfc['push'](_0x29ebfc['shift']());}};_0x4ede2f(++_0x256ebc);}(_0x3b43,0x115));var _0x33b4=function(_0x37a744,_0x22eb5c){_0x37a744=_0x37a744-0x0;var _0x12258e=_0x3b43[_0x37a744];return _0x12258e;};'use strict';var _=require(_0x33b4('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')[_0x33b4('0x1')];var db=require(_0x33b4('0x2'))['db'];var config=require('../../config/environment');var signToken=require(_0x33b4('0x3'))['signToken'];exports[_0x33b4('0x4')]=passport[_0x33b4('0x5')](_0x33b4('0x6'),{'failureRedirect':'/login','scope':[_0x33b4('0x7'),_0x33b4('0x8')],'session':![]});exports[_0x33b4('0x9')]=passport[_0x33b4('0x5')](_0x33b4('0x6'),{'failureRedirect':_0x33b4('0xa'),'session':![]});passport[_0x33b4('0xb')](new GoogleStrategy({'clientID':config['google']?config[_0x33b4('0x6')][_0x33b4('0xc')]:'id','clientSecret':config[_0x33b4('0x6')]?config[_0x33b4('0x6')]['clientSecret']:_0x33b4('0xd'),'callbackURL':config[_0x33b4('0x6')]?config[_0x33b4('0x6')][_0x33b4('0xe')]:''},function(_0x2d7f53,_0x44d711,_0x1da2c8,_0x36c5fc){db[_0x33b4('0xf')]['find']({'where':{'email':_[_0x33b4('0x10')](_0x1da2c8[_0x33b4('0x11')],_0x33b4('0x12')),'role':{'$or':['admin',_0x33b4('0x13'),_0x33b4('0x14')]}}})['then'](function(_0xf512c9){if(_0xf512c9){return _0x36c5fc(null,_0xf512c9);}_0x36c5fc(_0x33b4('0x15'));})[_0x33b4('0x16')](function(_0x5bdbac){_0x36c5fc(_0x5bdbac);});}));
\ No newline at end of file
+var _0x84f2=['email','callback','use','clientID','clientSecret','secret','callbackURL','User','find','map','admin','agent','then','catch','lodash','passport','passport-google-oauth20','../../mysqldb','signToken','login','authenticate','google','/login','profile'];(function(_0x27dbd9,_0x57bce9){var _0xb37f51=function(_0x4fd4f5){while(--_0x4fd4f5){_0x27dbd9['push'](_0x27dbd9['shift']());}};_0xb37f51(++_0x57bce9);}(_0x84f2,0x1ee));var _0x284f=function(_0x3c6a5e,_0x27f4e7){_0x3c6a5e=_0x3c6a5e-0x0;var _0x27104e=_0x84f2[_0x3c6a5e];return _0x27104e;};'use strict';var _=require(_0x284f('0x0'));var passport=require(_0x284f('0x1'));var GoogleStrategy=require(_0x284f('0x2'))['Strategy'];var db=require(_0x284f('0x3'))['db'];var config=require('../../config/environment');var signToken=require('../../components/auth/service')[_0x284f('0x4')];exports[_0x284f('0x5')]=passport[_0x284f('0x6')](_0x284f('0x7'),{'failureRedirect':_0x284f('0x8'),'scope':[_0x284f('0x9'),_0x284f('0xa')],'session':![]});exports[_0x284f('0xb')]=passport[_0x284f('0x6')]('google',{'failureRedirect':_0x284f('0x8'),'session':![]});passport[_0x284f('0xc')](new GoogleStrategy({'clientID':config[_0x284f('0x7')]?config['google'][_0x284f('0xd')]:'id','clientSecret':config[_0x284f('0x7')]?config[_0x284f('0x7')][_0x284f('0xe')]:_0x284f('0xf'),'callbackURL':config[_0x284f('0x7')]?config[_0x284f('0x7')][_0x284f('0x10')]:''},function(_0x3e988f,_0x242960,_0x4600ec,_0x5f14b7){db[_0x284f('0x11')][_0x284f('0x12')]({'where':{'email':_[_0x284f('0x13')](_0x4600ec['emails'],'value'),'role':{'$or':[_0x284f('0x14'),'user',_0x284f('0x15')]}}})[_0x284f('0x16')](function(_0x25938b){if(_0x25938b){return _0x5f14b7(null,_0x25938b);}_0x5f14b7('User\x20email\x20not\x20found!');})[_0x284f('0x17')](function(_0xdae9d8){_0x5f14b7(_0xdae9d8);});}));
\ No newline at end of file