fix(frontend): URL Encode Username and Password (#9 - @AaronBenDaniel)

* add URI encoding to credentials

* chore(api): Comment on FastAPI's automatic URL Decode

---------

Co-authored-by: TheOnlyWayUp <hi@towu.dev>
This commit is contained in:
AaronBenDaniel
2024-07-08 08:53:43 -04:00
committed by GitHub
parent b663448103
commit 0184c786ce
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -38,6 +38,7 @@ async def download_book(
)
if username and password:
# username and password are URL-Encoded by the frontend. FastAPI automatically decodes them.
try:
cookies = await wp_get_cookies(username=username, password=password)
except ValueError:
+1 -1
View File
@@ -19,7 +19,7 @@
`/download/${story_id}?om=1` +
(download_images ? "&download_images=true" : "") +
(is_paid_story
? `&username=${credentials.username}&password=${credentials.password}`
? `&username=${encodeURIComponent(credentials.username)}&password=${encodeURIComponent(credentials.password)}`
: "");
</script>