mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
WIP Items module.
This commit is contained in:
26
server/src/models/User.js
Normal file
26
server/src/models/User.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import bcrypt from 'bcryptjs';
|
||||
import bookshelf from './bookshelf';
|
||||
|
||||
const User = bookshelf.Model.extend({
|
||||
|
||||
/**
|
||||
* Table name
|
||||
*/
|
||||
tableName: 'users',
|
||||
|
||||
/**
|
||||
* Timestamp columns.
|
||||
*/
|
||||
hasTimestamps: ['created_at', 'updated_at'],
|
||||
|
||||
/**
|
||||
* Verify the password of the user.
|
||||
* @param {String} password - The given password.
|
||||
* @return {Boolean}
|
||||
*/
|
||||
verifyPassword(password) {
|
||||
return bcrypt.compareSync(password, this.get('password'));
|
||||
},
|
||||
});
|
||||
|
||||
export default bookshelf.model('User', User);
|
||||
Reference in New Issue
Block a user