From 6a1c3b2c6fe81e82de9e7b5547681e54ae394a32 Mon Sep 17 00:00:00 2001 From: Tuxt Date: Fri, 2 Aug 2024 19:02:53 +0200 Subject: [PATCH] fix(LoginMixin): update username and password attributes on new login --- instagrapi/mixins/auth.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/instagrapi/mixins/auth.py b/instagrapi/mixins/auth.py index 4326a2d6..1c4d6463 100644 --- a/instagrapi/mixins/auth.py +++ b/instagrapi/mixins/auth.py @@ -398,12 +398,12 @@ def login( A boolean value """ - if not self.username or not self.password: - if username is None or password is None: - raise BadCredentials("Both username and password must be provided.") - + if username and password: self.username = username self.password = password + + if self.username is None or self.password is None: + raise BadCredentials("Both username and password must be provided.") if relogin: self.authorization_data = {}