From c70f0ac9aeba68e1c798b8427779beaf048e43c6 Mon Sep 17 00:00:00 2001 From: Quentin Defenouillere Date: Tue, 12 Mar 2019 16:31:51 +0100 Subject: [PATCH] [cragr] Repair login for Paris website The login was broken because they "reinforced" the security at login: now to get the keypad we must pass the Referer in the headers as well as the login as data and POST the request. Closes: 10140@zendesk --- modules/cragr/api/browser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/cragr/api/browser.py b/modules/cragr/api/browser.py index 6e414d6e97..1d5ab4cbbd 100644 --- a/modules/cragr/api/browser.py +++ b/modules/cragr/api/browser.py @@ -195,7 +195,10 @@ def do_login(self): # Once the security check is passed, we are logged in. def get_security_form(self): - self.keypad.go() + headers = {'Referer': self.BASEURL + 'particulier/acceder-a-mes-comptes.html'} + data = {'user_id': self.username} + self.keypad.go(headers=headers, data=data) + keypad_password = self.page.build_password(self.password[:6]) keypad_id = self.page.get_keypad_id() assert keypad_password, 'Could not obtain keypad password' -- GitLab