1
0
Fork 0

backup codes

- add hotp_secret to user model
- view to create backup codes in user prefs
- check backup code if otp doesn't work
- increment hotp count if used
- show correct errors if code wrong
This commit is contained in:
Hugh Rundle 2022-09-18 19:52:53 +10:00
parent 9616abb6bd
commit 9b74c26742
7 changed files with 89 additions and 17 deletions

View file

@ -1,4 +1,4 @@
# Generated by Django 3.2.15 on 2022-09-11 05:25
# Generated by Django 3.2.15 on 2022-09-18 09:36
from django.db import migrations, models
@ -15,6 +15,11 @@ class Migration(migrations.Migration):
name="hotp_count",
field=models.IntegerField(blank=True, default=0, null=True),
),
migrations.AddField(
model_name="user",
name="hotp_secret",
field=models.CharField(blank=True, default=None, max_length=32, null=True),
),
migrations.AddField(
model_name="user",
name="otp_secret",