diff --git a/lib/framework/koa.js b/lib/framework/koa.js index fd19055..091e771 100644 --- a/lib/framework/koa.js +++ b/lib/framework/koa.js @@ -108,24 +108,8 @@ function authenticate(passport, name, options, callback) { // mock the `req` object const req = createReqMock(ctx, options.assignProperty || passport._userProperty || 'user') - /* - * res.end & res.send should basically behave the same - * res.end only takes strings (but should be okay for the mock to take more) - * res.send can send a buffer, object, array, or string - */ function setBodyAndResolve(content) { - switch (typeof content) { - case 'Buffer': - ctx.body = content.toString() - break - case 'object': - ctx.body = JSON.stringify(content) - break - case 'string': - default: - ctx.body = content - break - } + if (content) ctx.body = content resolve(false) }