Controlling TOTP Authetication

This commit is contained in:
Mohamed El-Kalioby
2021-06-24 18:42:33 +03:00
parent 0b83758625
commit ca49e1623d
8 changed files with 91 additions and 29 deletions

View File

@@ -33,11 +33,13 @@ class UserKey(models.Model):
class OTPTracker(models.Model):
username = models.CharField(max_length=50)
value = models.CharField(max_length = 6)
actor = models.CharField(
max_length=50, help_text="Username"
) # named this way for indexing purpose.
value = models.CharField(max_length=6)
success = models.BooleanField(blank=True)
done_on = models.DateTimeField(auto_now=True)
class Meta:
app_label = 'mfa'
indexes = [models.Index(fields=['username'])]
app_label = "mfa"
indexes = [models.Index(fields=["actor"])]