Added authGuard function and its implementations
Also refactored small code mistakes.
This commit is contained in:
@@ -6,13 +6,13 @@ require('./spell-model');
|
||||
|
||||
let User = bookshelf.Model.extend({
|
||||
tableName: 'user',
|
||||
hidden: [ 'password', 'role_id' ],
|
||||
hidden: ['password', 'role_id'],
|
||||
role() {
|
||||
return this.belongsTo( 'Role' );
|
||||
return this.belongsTo('Role');
|
||||
},
|
||||
spells() {
|
||||
return this.hasMany( 'Spell', 'author_id' );
|
||||
return this.hasMany('Spell', 'author_id');
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = bookshelf.model( 'User', User )
|
||||
module.exports = bookshelf.model('User', User)
|
||||
Reference in New Issue
Block a user