From 83b5918a6d5886e30354601955543f0a62d7a109 Mon Sep 17 00:00:00 2001 From: Tim Chan Date: Tue, 4 Apr 2017 20:12:00 +1000 Subject: [PATCH] Update client.py --- fbchat/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fbchat/client.py b/fbchat/client.py index 37c5138..1dbbe4c 100644 --- a/fbchat/client.py +++ b/fbchat/client.py @@ -230,11 +230,12 @@ class Client(object): r = self._cleanPost(LoginURL, data) - + # Usually, 'Checkpoint' will refer to 2FA if 'checkpoint' in r.url: r = self._2FA(r) - if 'save-device' in r.url: + # Sometimes Facebook tries to show the user a "Save Device" dialog + if 'save-device' in r.url and 'Enter Security Code to Continue' in r.text: r = self._cleanGet(SaveDeviceURL) if 'home' in r.url: