Trying to stay logged in this website using the request package but failing:
import requests
# Test account
payload = {"email": "ozeifaze@gmail.com", "password": "testpassword0?"}
with requests.Session() as s:
log = s.post("https://www.doctrine.fr/api/login", json=payload)
print(log) # <Response [200]> or <Response [422]> if wrong payload
print(log.text) # {"ok":true,"mfa_required":false}
page = s.get("https://www.doctrine.fr/dashboard")
print(page) # <Response [200]> but not authentified and redirected
The POST requests works and return what is expected. However, when I try to reach the second page, I'm not authentified anymore and I'm redirected to another page.
What am I doing wrong ?