1
0
Fork 0
peertube/server/initializers/migrations/0010-users-password.js
2016-09-26 23:10:32 +02:00

22 lines
479 B
JavaScript

/*
Convert plain user password to encrypted user password.
*/
const eachSeries = require('async/eachSeries')
const mongoose = require('mongoose')
const User = mongoose.model('User')
exports.up = function (callback) {
User.list(function (err, users) {
if (err) return callback(err)
eachSeries(users, function (user, callbackEach) {
user.save(callbackEach)
}, callback)
})
}
exports.down = function (callback) {
throw new Error('Not implemented.')
}