Commit 9fcdb89a authored by Guillaume Risbourg's avatar Guillaume Risbourg Committed by Vincent A

[bnporc] Fix expired password change

After modifiying the password, there is a call to another URL that is
done by the website to validate the password change.
The message returned by the json can variate, so we need to check if
there is an error based on the statut returned, not the error message.
parent 4dc02627
......@@ -176,8 +176,11 @@ class BNPParibasBrowser(LoginBrowser, StatesMixin):
data['nouveauPassword'] = vk.get_string_code(newpass)
data['passwordActuel'] = vk.get_string_code(oldpass)
response = self.location('/mcs-wspl/rpc/modifiercodesecret', data=data)
if response.json().get('messageIden').lower() == 'nouveau mot de passe invalide':
statut = response.json().get('statut')
self.logger.warning('Password change response : statut="%s" - message="%s"', statut, response.json().get('messageIden'))
if statut != '1':
return False
self.location('/mcs-wspl/rpc/validercodesecret')
return True
@need_login
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment