feat(*) initial commit

This commit is contained in:
Harminder Virk
2017-08-20 22:39:25 +05:30
commit 991657c76b
28 changed files with 1094 additions and 0 deletions

20
app/Models/Hooks/User.js Normal file
View File

@@ -0,0 +1,20 @@
'use strict'
const Hash = use('Hash')
const UserHook = module.exports = {}
/**
* Hash using password as a hook.
*
* @method
*
* @param {Object} userInstance
*
* @return {void}
*/
UserHook.hashPassword = async (userInstance) => {
if (userInstance.password) {
userInstance.password = await Hash.make(userInstance.password)
}
}