diff options
author | pouria <ezzati.upt@gmail.com> | 2022-01-30 14:27:11 +0300 |
---|---|---|
committer | pouria <ezzati.upt@gmail.com> | 2022-01-30 14:27:11 +0300 |
commit | 291d52a9b50ab4412a5d33544d981e9328acd57e (patch) | |
tree | ea02ae54f3fcaee3c274d1b58f05f333dd1ee650 | |
parent | a7fe4d3745c3ca02f46d91dc99b55750feb30f39 (diff) |
fix: disallow anonymous links when enabled for v1 api
Resolves #553
-rw-r--r-- | server/__v1/index.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/__v1/index.ts b/server/__v1/index.ts index 087c6fe..90f7629 100644 --- a/server/__v1/index.ts +++ b/server/__v1/index.ts @@ -8,6 +8,7 @@ import { } from "./controllers/validateBodyController"; import * as auth from "../handlers/auth"; import * as link from "./controllers/linkController"; +import env from "../env"; const router = Router(); @@ -16,7 +17,7 @@ router.post( "/url/submit", cors(), asyncHandler(auth.apikey), - asyncHandler(auth.jwtLoose), + asyncHandler(env.DISALLOW_ANONYMOUS_LINKS ? auth.jwt : auth.jwtLoose), asyncHandler(auth.recaptcha), asyncHandler(validateUrl), asyncHandler(ipCooldownCheck), |