Skip to content

Commit

Permalink
disable google recaptcha
Browse files Browse the repository at this point in the history
  • Loading branch information
EZ4BRUCE committed Jan 22, 2024
1 parent 1363f7c commit cdc2328
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions engine/apps/api/views/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,11 +417,13 @@ def timezone_options(self, request) -> Response:
)
def get_verification_code(self, request, pk) -> Response:
logger.info("get_verification_code: validating reCAPTCHA code")
valid = check_recaptcha_internal_api(request, "mobile_verification_code")
# skip google recaptcha
# valid = check_recaptcha_internal_api(request, "mobile_verification_code")
valid = True
if not valid:
logger.warning("get_verification_code: invalid reCAPTCHA validation")
return Response("failed reCAPTCHA check", status=status.HTTP_400_BAD_REQUEST)
logger.info('get_verification_code: pass reCAPTCHA validation"')
logger.info('get_verification_code: reCAPTCHA validation skiped"')

user = self.get_object()
phone_backend = PhoneBackend()
Expand All @@ -443,8 +445,9 @@ def get_verification_code(self, request, pk) -> Response:
throttle_classes=[GetPhoneVerificationCodeThrottlerPerUser, GetPhoneVerificationCodeThrottlerPerOrg],
)
def get_verification_call(self, request, pk) -> Response:
logger.info("get_verification_code_via_call: validating reCAPTCHA code")
valid = check_recaptcha_internal_api(request, "mobile_verification_code")
# skip google recaptcha
# valid = check_recaptcha_internal_api(request, "mobile_verification_code")
valid = True
if not valid:
logger.warning("get_verification_code_via_call: invalid reCAPTCHA validation")
return Response("failed reCAPTCHA check", status=status.HTTP_400_BAD_REQUEST)
Expand Down
2 changes: 1 addition & 1 deletion engine/apps/phone_notifications/mocloud_phone_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def finish_verification(self, number, code):
Skip sms verification
"""
has = cache.get(self._cache_key(number))
if has is not None and has == code:
if has is not None:
return number
else:
return None
Expand Down

0 comments on commit cdc2328

Please sign in to comment.