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:
@@ -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:
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user