From d93b6127c407bf52158a5bafdbd5cc48e0ec2557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Fri, 25 Jul 2014 11:00:22 +0200 Subject: [PATCH] Remove `req.resume` from `app.enableAuth` Remove `req.pause` and `req.resume` from `app.enableAuth` - they are no longer needed, the request starts paused and there is no other middleware that would resume it before us. - when we resume the request after authentication, we force all other async operations (like sharedCtor) to call pause & resume too, otherwise data are lost --- lib/application.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/application.js b/lib/application.js index 6fda62f3..b9facad0 100644 --- a/lib/application.js +++ b/lib/application.js @@ -316,17 +316,12 @@ app.enableAuth = function() { } if(Model.checkAccess) { - // Pause the request before checking access - // See https://github.com/strongloop/loopback-storage-service/issues/7 - req.pause(); Model.checkAccess( req.accessToken, modelId, method, ctx, function(err, allowed) { - // Emit any cached data events that fired while checking access. - req.resume(); if(err) { console.log(err); next(err);