Skip to content
Snippets Groups Projects
Commit 0f6fcc68 authored by Louis's avatar Louis :fire:
Browse files

Allow chaining when setting user plaintext password

parent 12531566
No related branches found
No related tags found
No related merge requests found
......@@ -55,6 +55,7 @@ module.exports = (sequelize, DataTypes) => {
Model.prototype.setPlaintextPassword = async function(password) {
const crypto = require('core/utils/crypto')
this.setDataValue('password', await crypto.hash(password))
return this
}
Model.prototype.asToken = async function() {
const crypto = require('core/utils/crypto')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment