code: function(req, res) {
            var api_name = req.params.api;
            var session = req.session;
            var apis = session.apis || {};
            var api = apis[api_name] || {};
            var user_id = session.user.id;
            var db_api = {};
            var consumer_key = api_keys[api_name].consumer_key;
            var consumer_secret = api_keys[api_name].consumer_secret;
  
            var oa = new OAuth(
              api.request_token_url,
              api.access_token_url,
              consumer_key,
              consumer_secret,
              api.oauth_version,
              api.callback_url,
              api.signature_method
            );
  
            session.apis = apis;
            apis[api_name] = api;
  
            oa.getOAuthAccessToken(
              api.oauth_request_token,
              api.oauth_request_token_secret,
              req.params['oauth_verifier'],
              function (error, oauth_access_token, oauth_access_token_secret, results) {
                if (error) {
                  console.log('error in oauth authentication process: ');
                  console.dir(error);
                  return;
                }
  
                // store the access token in the DB
                db_api.oauth_access_token = oauth_access_token;
                db_api.oauth_access_token_secret = oauth_access_token_secret;
  
                sa
                  .post(apily_server + '/apily/0/user/' + user_id + '/api/' + api_name)
                  .send(db_api)
                  .end(function(err, sa_res) {
                    if (err) {
                      res.status(sa_res.statusCode).send('db comunication error');
                      return;
                    }
  
                    // store the access token in the session
                    api.oauth_access_token = oauth_access_token;
                    api.oauth_access_token_secret = oauth_access_token_secret;
  
  
                    // note that endpoind could be decided client-side
                    res.redirect(api.client_callback_url);
                  });
              }
            );
          }
docs: is_logged, *