From c0efda36cdd94b8a86a58d0dfc2e665f3f289a93 Mon Sep 17 00:00:00 2001 From: undefined Date: Fri, 22 Jan 2021 22:41:11 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E4=BF=AE=E5=A4=8D=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E9=87=8D=E6=96=B0=E7=99=BB=E5=BD=95=E6=97=B6?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=88=B0=E4=B8=BB=E5=9F=9F=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hydrooj/src/handler/user.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/hydrooj/src/handler/user.ts b/packages/hydrooj/src/handler/user.ts index 07bc9fc0..1afb4d14 100644 --- a/packages/hydrooj/src/handler/user.ts +++ b/packages/hydrooj/src/handler/user.ts @@ -38,7 +38,9 @@ class UserLoginHandler extends Handler { this.session.uid = udoc._id; this.session.scope = PERM.PERM_ALL.toString(); this.session.save = rememberme; - this.response.redirect = this.request.referer.endsWith('/login') ? '/' : this.request.referer; + this.response.redirect = this.request.referer.endsWith('/login') + ? this.url('homepage') + : this.request.referer; } }