Skip to content

Instantly share code, notes, and snippets.

Created November 3, 2014 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6fb9e0a5deec1e5b2c68 to your computer and use it in GitHub Desktop.
Save anonymous/6fb9e0a5deec1e5b2c68 to your computer and use it in GitHub Desktop.
curious hooks behaviour
module.exports = function (AccessToken) {
AccessToken.beforeSave = function(next, token) {
console.log('This function works...');
next();
};
AccessToken.beforeRemote('*.save', function(ctx, token, next) {
console.log('This one doesn\'t...');
//token.ip = ctx.req.connection.remoteAddress;
next();
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment