Files
medusa-store/integration-tests/helpers/admin-seeder.js
Stevche Radevski d680c7ee4c Remove v1-related code from medusa app (#7326)
* 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
2024-05-14 13:21:30 +02:00

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 }
}