diff --git a/api/blueprints/common/otp/timed_otp.py b/api/blueprints/common/otp/timed_otp.py index 7ec82b1..c50f6fa 100644 --- a/api/blueprints/common/otp/timed_otp.py +++ b/api/blueprints/common/otp/timed_otp.py @@ -340,6 +340,7 @@ async def verify_otp( ) # If the OTP failed: + print("OTP RESPONSE:", otp_response) if not otp_response.success: return ResponseModel( status_code = StatusCodes.FAILED, http_code = HttpCodes.UNAUTHORIZED, @@ -388,9 +389,12 @@ async def verify_otp( # Done here: success = api_response.is_success + print("ADD CLIENT WITH NOTES CODE:", api_response.status_code) + print("ADD CLIENT WITH NOTES JSON:", api_response.json()) return ResponseModel( status_code = StatusCodes.OK if success else StatusCodes.FAILED, - http_code = HttpCodes.SUCCESS if success else HttpCodes.UNAUTHORIZED + http_code = HttpCodes.SUCCESS if success else HttpCodes.UNAUTHORIZED, + message = api_response.json().get("message", "N/A") ) diff --git a/controllers_v2/common/otp/timed_otp.py b/controllers_v2/common/otp/timed_otp.py index 9fac95a..2ae55e1 100644 --- a/controllers_v2/common/otp/timed_otp.py +++ b/controllers_v2/common/otp/timed_otp.py @@ -160,6 +160,7 @@ class TimedOTPController: # Generate the OTP: otp_key = self.KEY_PREFIX + redis_cache.make_key(str(inbound_data.id)) + print("GENERATE KEY:", otp_key) otp_client = HashedOTP(secret = HashedOTP.generate_secret()) otp = otp_client.generate_otp(count = 0) @@ -207,6 +208,7 @@ class TimedOTPController: # Fetch the OTP from Redis: otp_key = self.KEY_PREFIX + redis_cache.make_key(str(inbound_data.id)) + print("VERIFY KEY:", otp_key) stored_otp = await redis_cache.get(key = otp_key) if not stored_otp: response.message = "No OTP found for this request. It may have expired."