@cocalc/database
Version:
CoCalc: code for working with our PostgreSQL database
16 lines • 693 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const pool_1 = __importDefault(require("@cocalc/database/pool"));
const password_hash_1 = __importDefault(require("@cocalc/backend/auth/password-hash"));
async function setPassword(account_id, password) {
const pool = (0, pool_1.default)();
await pool.query("UPDATE accounts SET password_hash=$1 WHERE account_id=$2", [
(0, password_hash_1.default)(password),
account_id,
]);
}
exports.default = setPassword;
//# sourceMappingURL=set-password.js.map