* chore: Remove unused validations and utilities * chore: Remove all resources that are not being loaded * chore: Remove unused dependencies, typeorm related code and fix tests * chore: Use createAdminUser in all module tests
17 lines
404 B
JavaScript
17 lines
404 B
JavaScript
const Scrypt = require("scrypt-kdf")
|
|
|
|
module.exports = async (dataSource, data = {}) => {
|
|
const manager = dataSource.manager
|
|
|
|
const buf = await Scrypt.kdf("secret_password", { logN: 15, r: 8, p: 1 })
|
|
const password_hash = buf.toString("base64")
|
|
|
|
const user = await manager.insert("user", {
|
|
id: "admin_user",
|
|
email: "admin@medusa.js",
|
|
...data,
|
|
})
|
|
|
|
return { user, password_hash }
|
|
}
|