Skip to content

Instantly share code, notes, and snippets.

@frytaz
Last active December 25, 2015 20:49
Show Gist options
  • Save frytaz/7037771 to your computer and use it in GitHub Desktop.
Save frytaz/7037771 to your computer and use it in GitHub Desktop.
Ghost node.js blogging platform password reset script
var bcrypt = require('bcrypt-nodejs'),
sqlite3 = require('sqlite3').verbose();
var file = 'content/data/ghost-dev.db';
var db = new sqlite3.Database(file);
var password = 'YOUR_NEW_PASSWD';
bcrypt.hash(password, null, null, function(err, hash) {
db.serialize(function() {
db.run("UPDATE users SET password = ? WHERE id = ?", hash, 1);
console.log('done');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment