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
This commit is contained in:
parent
d82d789ffa
commit
d93b6127c4
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue