Skip to content

Commit aeb5f82

Browse files
author
lucifer
committed
feat: early return
1 parent 746bbfd commit aeb5f82

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

middleware/passport.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module.exports = async function checkAuth(ctx, next) {
1414
if (!ctx.session) {
1515
ctx.session = {};
1616
}
17+
if (ctx.session.user) next();
1718
const token = ctx.cookies.get("token");
1819

1920
if (token) {

0 commit comments

Comments
 (0)