Beispiel #1
0
 request.get({url:newUrl}, function(err, resp, body) {
     if (options.accessTokenResponse == 'json') {
         exports.auth.accessToken = JSON.parse(body).access_token;
     } else {
         exports.auth.accessToken = querystring.parse(body).access_token;
     }
     lfs.writeObjectToFile("auth.json", exports.auth);
     completedCallback(exports.auth);
     res.redirect(options.redirectURI);
 });
Beispiel #2
0
 lcrypto.loadKeys(function() {
     // We put in the encrypted values for writing to the disk
     exports.auth.username = lcrypto.encrypt(req.body.username);
     exports.auth.password = lcrypto.encrypt(req.body.password);
     exports.auth.host = req.body.host;
     exports.auth.port = req.body.port;
     exports.auth.secure = req.body.secure;
     lfs.writeObjectToFile('auth.json', exports.auth);
     // Put back the non encrypted values
     exports.auth.username = req.body.username;
     exports.auth.password = req.body.password;
     completedCallback(exports.auth);
     res.redirect(uri);
 });