1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-03-13 08:58:35 +03:00

TOPT time is got from DBSERVER

This commit is contained in:
Adolfo Gómez García 2023-02-24 14:40:07 +01:00
parent a7ae7d3771
commit 56d7619e9f
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23

View File

@ -78,7 +78,7 @@ class TOTP_MFA(mfas.MFA):
validWindow = gui.NumericField(
length=2,
label=_('Valid Window'),
defvalue=0,
defvalue=1,
minValue=0,
maxValue=10,
order=31,
@ -235,7 +235,8 @@ class TOTP_MFA(mfas.MFA):
# Validate code
if not self.getTOTP(userId, username).verify(
code, valid_window=self.validWindow.num()
code, valid_window=self.validWindow.num(),
for_time = models.getSqlDatetime()
):
raise exceptions.MFAError(gettext('Invalid code'))