You must have a least one admin account before being able to login on the admin interface (then being able to create other user). Create the first user with mongo request.

use hcw-athome;
db.user.insertOne({email:"", firstName:"Admin", lastName:"", role: "admin", createdAt: new Date().getTime(), password: "$2b$10$uip0TKwn.kbO1s1C3jO0au4ymxjkgd.kg9ueH2oV02I4gJBKzH.2m", "updatedAt": new Date().getTime(), "username" : "", phoneNumber: ""})

This command will create user with login "" and password "admin".

If you need to customize this passsword and you have nodejs installed (or you do on your server), you can use the following script, by example into password.js, don't forgot to update 'not hashed password'.

const bcrypt = require('bcrypt');

bcrypt.hash('not hashed password', 10, function(err, hash) {
if(err) console.log(err)

You will need to install bcrypt with the following command.

npm install bcrypt

Then run the script with:

node password.js
0 0

Il n'y a aucun commentaire pour le moment.

pour être le premier à laisser un commentaire.