From 79dc5e238df865eb1e7f2415c19296c3adc402ce Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 25 Jul 2024 02:22:22 +0200 Subject: [PATCH] [core] Skip 2FA code verification for JWT tokens. --- platypush/user/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platypush/user/__init__.py b/platypush/user/__init__.py index 27fdd06f9d..7c416385e9 100644 --- a/platypush/user/__init__.py +++ b/platypush/user/__init__.py @@ -419,7 +419,7 @@ class UserManager: :return: The generated JWT token as a string. :raises: :class:`platypush.exceptions.user.InvalidCredentialsException` in case of invalid credentials. """ - user = self.authenticate_user(username, password) + user = self.authenticate_user(username, password, skip_2fa=True) if not user: raise InvalidCredentialsException() @@ -457,7 +457,7 @@ class UserManager: raise InvalidJWTTokenException('Expired JWT token') user = self.authenticate_user( - payload.get('username', ''), payload.get('password', '') + payload.get('username', ''), payload.get('password', ''), skip_2fa=True ) if not user: