Permalink
Browse files

Replaced argon2 with bcryptjs

  • Loading branch information...
rlindskog committed Oct 4, 2017
1 parent 77ba593 commit 0a598ea144f64558149177998c0dd9135c64f5b6
Showing with 2 additions and 2 deletions.
  1. +2 −2 template/scripts/create-admin.js
@@ -3,13 +3,13 @@ require('dotenv').config({
})
const MongoClient = require('mongodb').MongoClient
const uuidv4 = require('uuid/v4')
const argon2 = require('argon2')
const bcrypt = require('bcryptjs')
async function createAdmin (username = 'remove-this-admin', email = 'admin@email.com') {
try {
let db = await MongoClient.connect(process.env.DB_URL)
let rand = uuidv4().split('-').join('')
let password = await argon2.hash(rand)
let password = await bcrypt.hash(this.password, 10)
await db.collection('users').insertOne({ username, email, password, admin: true })
console.log(`
username: ${username}

0 comments on commit 0a598ea

Please sign in to comment.