Skip to content

Commit 47a4473

Browse files
committed
fix: fixed usage issue where logger defined after
1 parent d943a54 commit 47a4473

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ class RedirectLoop {
2121
}
2222

2323
async middleware(ctx, next) {
24+
const { config } = this;
25+
const { redirect } = ctx;
26+
2427
if (!ctx.session) {
2528
config.logger.error(
2629
new Error(
@@ -39,9 +42,6 @@ class RedirectLoop {
3942
return next();
4043
}
4144

42-
const { config } = this;
43-
const { redirect } = ctx;
44-
4545
ctx.redirect = function (url, alt) {
4646
let address = url;
4747

0 commit comments

Comments
 (0)