diff --git a/classquiz/routers/editor.py b/classquiz/routers/editor.py index cfd356a..1add4c9 100644 --- a/classquiz/routers/editor.py +++ b/classquiz/routers/editor.py @@ -88,7 +88,6 @@ class UploadImageReturn(BaseModel): @router.post("/image", response_model=UploadImageReturn) async def upload_image(edit_id: str, pow_data: str, file: UploadFile = File()): - print(pow_data) session_data = await redis.get(f"edit_session:{edit_id}") pow_data_server = await redis.get(f"edit_session:{edit_id}:pow") uploaded_images = await redis.llen(f"edit_session:{edit_id}:images") @@ -97,9 +96,9 @@ async def upload_image(edit_id: str, pow_data: str, file: UploadFile = File()): if session_data is None: raise HTTPException(status_code=401, detail="Edit ID not found!") - if uploaded_images == 0 and not check_hashcash(pow_data, pow_data_server, "19"): + if uploaded_images == 0 and not check_hashcash(pow_data, pow_data_server, "16"): raise HTTPException(status_code=401, detail="Edit ID not found!") - if uploaded_images != 0 and not check_hashcash(pow_data, pow_data_server, "17"): + if uploaded_images != 0 and not check_hashcash(pow_data, pow_data_server, "16"): raise HTTPException(status_code=401, detail="Edit ID not found!") file_bytes = await file.read() if len(file_bytes) < 2000: diff --git a/frontend/src/lib/editor.svelte b/frontend/src/lib/editor.svelte index 2d2b728..d5ce00f 100644 --- a/frontend/src/lib/editor.svelte +++ b/frontend/src/lib/editor.svelte @@ -106,7 +106,7 @@ const res = await fetch(`/api/v1/editor/pow?edit_id=${edit_id}`); const data = (await res.json()).data; console.log(data); - pow_data = await mint(data); + pow_data = await mint(data, 16); console.log(pow_data); }; diff --git a/frontend/src/lib/editor/card.svelte b/frontend/src/lib/editor/card.svelte index 6452d5c..1059ea6 100644 --- a/frontend/src/lib/editor/card.svelte +++ b/frontend/src/lib/editor/card.svelte @@ -36,7 +36,7 @@ return; } console.log('Computing POW'); - pow_data = await mint(salt, 17, '', 8, false); + pow_data = await mint(salt, 16, '', 8, false); pow_salt = undefined; return; };