aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations/0010-users-password.js
blob: e031fa142457c55e41a35f48143482810eef6d3a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
  Convert plain user password to encrypted user password.
*/

const mongoose = require('mongoose')

const User = mongoose.model('User')

exports.up = function (callback) {
  User.list(function (err, users) {
    if (err) return callback(err)

    users.forEach(function (user) {
      user.save()
    })

    return callback(null)
  })
}

exports.down = function (callback) {
  throw new Error('Not implemented.')
}