Last active
December 25, 2015 20:49
-
-
Save frytaz/7037771 to your computer and use it in GitHub Desktop.
Ghost node.js blogging platform password reset script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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