Added authGuard function and its implementations
Also refactored small code mistakes.
This commit is contained in:
@@ -5,10 +5,10 @@ require('./user-model');
|
||||
|
||||
let APIToken = bookshelf.Model.extend({
|
||||
tableName: 'api_token',
|
||||
hidden: [ 'id' ],
|
||||
hidden: ['id'],
|
||||
user() {
|
||||
return this.hasOne( 'User', 'user_uuid' );
|
||||
return this.belongsTo('User', 'user_uuid', 'uuid');
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = bookshelf.model( 'APIToken', APIToken );
|
||||
module.exports = bookshelf.model('APIToken', APIToken);
|
||||
Reference in New Issue
Block a user