diff --git a/index.js b/index.js index 8a7a6a9..9f4cf0c 100644 --- a/index.js +++ b/index.js @@ -204,7 +204,10 @@ module.exports = function (options) { redirect(ctx, loginURL); })(); - return yield options.redirectHandler.call(this, nextHandler, next); + return yield options.redirectHandler.call(this, nextHandler, function* (){ + this.session[options.userField] = null; + yield next; + }); } debug('get user directly');