diff --git a/uffd/mfa/models.py b/uffd/mfa/models.py index fd8870ffe79d508f57180e26b2c3fe97844a1423..fccae0e8cbe025495e5a3213bfdf87feb0e7082c 100644 --- a/uffd/mfa/models.py +++ b/uffd/mfa/models.py @@ -57,6 +57,8 @@ class RecoveryCodeMethod(MFAMethod): def __init__(self, user): super().__init__(user, None) + # The code attribute is only available in newly created objects as only + # it's hash is stored in the database self.code = secrets.token_hex(8).replace(' ', '').lower() self.code_hash = crypt.crypt(self.code)