Skip to content

Commit

Permalink
fix QR code login
Browse files Browse the repository at this point in the history
Some PRONOTE instances require an additional "magic" query parameter to
not redirect to CAS.
  • Loading branch information
bain3 committed Nov 19, 2023
1 parent fe96c94 commit 0240969
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pronotepy/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,15 @@ def qrcode_login(cls: Type[T], qr_code: dict, pin: str, uuid: str) -> T:
except CryptoError as ex:
raise QRCodeDecryptError("invalid confirmation code") from ex

# add ?login=true at the end of the url
url = re.sub(r"(\?.*)|( *)$", "?login=true", qr_code["url"], 0)
# Add magic parameters at the end of the URL. You can find them in a
# file called "ObjetCommMessage.js" in the connection method when you
# decompile the mobile APK.
url = re.sub(
r"(\?.*)|( *)$",
"?bydlg=A6ABB224-12DD-4E31-AD3E-8A39A1C2C335&login=true",
qr_code["url"],
0,
)

return cls(url, login, jeton, mode="qr_code", uuid=uuid)

Expand Down

0 comments on commit 0240969

Please sign in to comment.