Skip to content

Commit

Permalink
fix: fixed usage issue where logger defined after
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Jul 1, 2022
1 parent d943a54 commit 47a4473
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class RedirectLoop {
}

async middleware(ctx, next) {
const { config } = this;
const { redirect } = ctx;

if (!ctx.session) {
config.logger.error(
new Error(
Expand All @@ -39,9 +42,6 @@ class RedirectLoop {
return next();
}

const { config } = this;
const { redirect } = ctx;

ctx.redirect = function (url, alt) {
let address = url;

Expand Down

0 comments on commit 47a4473

Please sign in to comment.