title: Query executing multiple times when using google social login with passport and sequelize
body: <p>Hi Guys this is my first question so please be patient, I'm having a problem using passport with sequelize, the problem happens after i search at the database for the record to check if the user already exists but when passport deserializes it, Sequelize executes five 'select queries', the code is similar to one i found in scotch.io i just attached sequelize api to it:</p>
  
  <pre><code>module.exports = function (passport) {
  
      // used to serialize the user for the session
      passport.serializeUser(function (user, done) {
          done(null, user.iduser);
      });
  
      // used to deserialize the user
      passport.deserializeUser(function (id, done) {
          userModel.findById(id)
          .then(function (userVo) {
              done(null, userVo);
          }).catch(function(err) {
              if(err)
                  throw err;
          })
      });
  
      passport.use(new GoogleStrategy({
              clientID: 'XXXXX',
              clientSecret: 'XXXXXX',
              callbackURL: 'XXXXX'
          },
          function (token, refreshToken, profile, done) {
              // make the code asynchronous
              // User.findOne won't fire until we have all our data back from Google
              process.nextTick(function () {
                  // try to find the user based on their google id
                  sequelize.transaction(function (t) {
                          return sociaLoginModel.findOne({
                                  where: {
                                      idprovided: profile.id,
                                      logintype: constants.GOOGLE_LOGIN_TYPE
                                  }
                              }, {
                                  transaction: t
                              })
                              .then(function (socialLoginResult) {
                                  //if user was found, then retrieve and create a session for him returning the value to done
                                  var socialLoginVo;
                                  if (socialLoginResult) {
                                      socialLoginVo = socialLoginResult.dataValues
                                      return userModel.findById(socialLoginVo.tb11_fkuser, {
                                              transaction: t
                                          })
                                          .then(function (userResult) {
                                              return userResult.dataValues;
                                          });
                                  } else {
                                      return individualsModel.create({
                                              name: profile.displayName
                                          }, {
                                              transaction: t
                                          })
                                          .then(function (individualsResult) {
                                              var individualsVo = individualsResult.dataValues
                                              return userModel.create({
                                                      email: profile.emails[0].value,
                                                      user_type: constants.USER_INDIVIDUALS,
                                                      tb12_fkindividuals: individualsVo.idindividuals
                                                  }, {
                                                      transaction: t
                                                  })
                                                  .catch(function (err) {
                                                      if (err)
                                                          throw err;
                                                  })
                                                  .then(function (userResult) {
                                                      var userVo = userResult.dataValues
                                                      console.log(typeof profile.id)
                                                      return sociaLoginModel.create({
                                                              idprovided: profile.id,
                                                              token: token,
                                                              logintype: constants.GOOGLE_LOGIN_TYPE,
                                                              tb11_fkuser: userVo.iduser
                                                          }, {
                                                              transaction: t
                                                          })
                                                          .then(function (sociaLoginResult) {
                                                              return userVo
                                                          })
                                                          .catch(function(err) {
                                                              if(err)
                                                                  throw err;
                                                          })
                                                  })
                                          }).catch(function(err) {
                                              if(err)
                                                  throw err
                                          })
                                  }
                              }).catch(function(err) {
                                  if(err)
                                      throw err
                              })
                      }).then(function (result) {
                          return done(null, result);
                      }).catch(function (err) {
                          if (err) 
                              return done(err)
                      });
              })
          }))
  };
  </code></pre>
  
  <p>This code is in a file and i use it as a middleware in app.js calling:</p>
  
  <pre><code>require('./logins/google')(passport);
  </code></pre>
  
  <p>I do that with local-login and facebook too, as almost the same code as in google login, why does Sequelize is executing that number of queries?? Am i doing something wrong?? How can i minimize that number? Thanks.</p>