Skip to content

Instantly share code, notes, and snippets.

@babolivier
Created April 8, 2016 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save babolivier/70b98435c933ef68ab6d625e7524f30f to your computer and use it in GitHub Desktop.
Save babolivier/70b98435c933ef68ab6d625e7524f30f to your computer and use it in GitHub Desktop.
var cozydb = require("cozydb");
var data = cozydb.getModel('User', {})
update = function(id) {
data.updateAttributes(id, {
otpKey: "7lmt5npm7p",
hotpCounter: 0,
authType: "hotp"
}, function(err) {
if(err) { console.log(err); }
else { console.log("Sent"); }
});
}
data.request("all", function(err, results) {
if(err) { console.log(err); process.exit(); }
else { update(results[0]._id); }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment