1
0
Fork 1
mirror of https://example.com synced 2024-11-22 17:46:39 +09:00

fix (backend): check url properly

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
naskya 2024-02-25 20:30:03 +09:00
parent 949084e218
commit e4bcd23f9d
Signed by: naskya
GPG key ID: 712D413B3A9FED5C

View file

@ -54,7 +54,9 @@ const bullBoardPath = "/queue";
// Authenticate // Authenticate
app.use(async (ctx, next) => { app.use(async (ctx, next) => {
if (ctx.path === bullBoardPath || ctx.path.startsWith(`${bullBoardPath}/`)) { const url = decodeURI(ctx.path);
if (url === bullBoardPath || url.startsWith(`${bullBoardPath}/`)) {
const token = ctx.cookies.get("token"); const token = ctx.cookies.get("token");
if (token == null) { if (token == null) {
ctx.status = 401; ctx.status = 401;