diff options
author | Kristofer Hallin <kristofer@sunet.se> | 2021-11-26 12:35:50 +0100 |
---|---|---|
committer | Kristofer Hallin <kristofer@sunet.se> | 2021-11-26 12:35:50 +0100 |
commit | f118413da7151822ab96de7eb6153bce50c14f81 (patch) | |
tree | 0c5e9b0770528b647293f3e8e03ec05d376972f0 /src | |
parent | a63a27f40a36224f7e596d730d014946253aa297 (diff) |
Require JWT token for the /delete endpoint.
Diffstat (limited to 'src')
-rwxr-xr-x | src/main.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.py b/src/main.py index fef4050..ad8aada 100755 --- a/src/main.py +++ b/src/main.py @@ -156,7 +156,10 @@ async def add(data: Request, Authorize: AuthJWT = Depends()): @app.delete('/sc/v0/delete/{key}') -async def delete(key): +async def delete(key, Authorize: AuthJWT = Depends()): + + Authorize.jwt_required() + if db.delete(key) is None: return JSONResponse(content={"status": "error", "message": "Document not found"}, |