Merge pull request #1444 from subbink/1237-otp-with-site-name

Make the OTP label the same as the site_name #1237
This commit is contained in:
Matt Scott 2023-03-13 19:19:28 -04:00 committed by GitHub
commit 4420621cfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,8 +90,8 @@ class User(db.Model):
return '<User {0}>'.format(self.username)
def get_totp_uri(self):
return "otpauth://totp/PowerDNS-Admin:{0}?secret={1}&issuer=PowerDNS-Admin".format(
self.username, self.otp_secret)
return "otpauth://totp/{0}:{1}?secret={2}&issuer=PowerDNS-Admin".format(
Setting().get('site_name'), self.username, self.otp_secret)
def verify_totp(self, token):
totp = pyotp.TOTP(self.otp_secret)