otp bug solved
This commit is contained in:
@@ -68,7 +68,7 @@ def authticate_with_otp_and_passsword(principal: IAmPrincipal, otp=None, passwor
|
||||
|
||||
if otp:
|
||||
otp_instance = IAmPrincipalOtp.objects.filter(
|
||||
principal=principal, otp_code=otp
|
||||
principal=principal, otp_code=otp, is_used=False
|
||||
).last()
|
||||
|
||||
if not otp_instance:
|
||||
|
||||
@@ -148,6 +148,7 @@ class SMSService:
|
||||
|
||||
def create_otp(self, principal: IAmPrincipal, opt_purpose: str):
|
||||
old_otp_change = IAmPrincipalOtp.objects.filter(principal=principal).update(is_used=True)
|
||||
print("Everything Is Used..!!")
|
||||
otp = IAmPrincipalOtp.objects.create(
|
||||
principal=principal, otp_purpose=opt_purpose
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user