This commit is contained in:
parent
6c4f174ad4
commit
627e2636eb
1 changed files with 5 additions and 1 deletions
|
|
@ -44,7 +44,11 @@ class RegisterView(APIView):
|
|||
logger.info("Generated email OTP for %s: %s", user.username, otp_email)
|
||||
|
||||
# Temporarily save OTPs to profile so frontend can query them until email service is implemented
|
||||
profile.phone = f"{profile.phone} (OTP: {otp_phone})"
|
||||
# Do not save the OTP suffix in the phone field if it exceeds the 20-character database limit
|
||||
otp_suffix = f" (OTP: {otp_phone})"
|
||||
current_phone = profile.phone or ""
|
||||
if len(current_phone) + len(otp_suffix) <= 20:
|
||||
profile.phone = f"{current_phone}{otp_suffix}"
|
||||
profile.save()
|
||||
|
||||
# Store OTP hashes
|
||||
|
|
|
|||
Loading…
Reference in a new issue