Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7cc042a

Browse files
committed
fix: block global API token from /user
1 parentdd029c3 commit7cc042a

File tree

1 file changed

+4
-1
lines changed
  • apps/api/src/middlewares/auth/utils

1 file changed

+4
-1
lines changed

‎apps/api/src/middlewares/auth/utils/utils.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ export function isRouteDisabled(options: Pick<Options, "req">) {
1515
consturl=options.req.originalUrl.toLowerCase();
1616
constrequestMethod=options.req.methodasMethod;
1717

18-
constroute=DISABLED_API_TOKEN_ROUTES.find(([r])=>url.endsWith(r));
18+
constroute=DISABLED_API_TOKEN_ROUTES.find(([pathname])=>{
19+
consturlPathname=newURL(url,"https://example.com").pathname.toLowerCase();
20+
returnurlPathname.endsWith(pathname.toLowerCase());
21+
});
1922

2023
if(route){
2124
const[,methods]=route;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp