[ADD] BASE: 2 Factor Authentication via email (beta)

This commit is contained in:
Horilla
2025-05-21 11:19:12 +05:30
parent 9f66406cd6
commit 97f1843db2
8 changed files with 265 additions and 18 deletions

View File

@@ -1007,3 +1007,12 @@ def template_pdf(template, context={}, html=False, filename="payslip.pdf"):
return response
except Exception as e:
return HttpResponse(f"Error generating PDF: {str(e)}", status=500)
def generate_otp():
"""
Function to generate a random 6-digit OTP (One-Time Password).
Returns:
str: A 6-digit random OTP as a string.
"""
return str(random.randint(100000, 999999))