Browse Source

Set name, realm and seed for superusers also

master
PCoder 3 years ago
parent
commit
9703eb6538
  1. 3
      otpauth/models.py

3
otpauth/models.py

@ -4,6 +4,7 @@ from rest_framework import exceptions
from rest_framework import authentication
import json
import logging
import pyotp
logger = logging.getLogger(__name__)
@ -25,6 +26,8 @@ class OTPSeed(AbstractUser):
self.username = "{}@{}".format(self.name, self.realm)
else:
self.name = self.username
self.realm = "ungleich-admin"
self.seed = pyotp.random_base32()
super().save(*args, **kwargs)

Loading…
Cancel
Save