Fix hook arguments issue

This commit is contained in:
Juan Cruz Viotti 2014-11-19 09:14:40 -04:00
parent 98f4dc8e19
commit 3015af3aeb

View File

@ -3,8 +3,9 @@ messages = require('../messages/messages')
exports.failIfNotLoggedIn = (fn) ->
return ->
args = arguments
auth.isLoggedIn (isLoggedIn) ->
if not isLoggedIn
throw new Error(messages.errors.loginRequired)
fn.apply(null, arguments)
fn.apply(null, args)