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

Fixed parameters order for coherence

This commit is contained in:
Adolfo Gómez García
2023-02-23 16:56:42 +01:00
parent 52096b1eff
commit 165bd89829
6 changed files with 6 additions and 6 deletions

View File

@ -124,7 +124,7 @@ class MFA(Module):
""" """
return 'MFA Code' return 'MFA Code'
def html(self, userId: str, request: 'ExtendedHttpRequest', username: str) -> str: def html(self, request: 'ExtendedHttpRequest', userId: str, username: str) -> str:
""" """
This method will be invoked from the MFA form, to know the HTML that will be presented This method will be invoked from the MFA form, to know the HTML that will be presented
to the user below the MFA code form. to the user below the MFA code form.

View File

@ -182,7 +182,7 @@ class EmailMFA(mfas.MFA):
self.fromEmail.value = validators.validateEmail(self.fromEmail.value) self.fromEmail.value = validators.validateEmail(self.fromEmail.value)
def html(self, userId: str, request: 'ExtendedHttpRequest', username: str) -> str: def html(self, request: 'ExtendedHttpRequest', userId: str, username: str) -> str:
return gettext('Check your mail. You will receive an email with the verification code') return gettext('Check your mail. You will receive an email with the verification code')
@classmethod @classmethod

View File

@ -193,7 +193,7 @@ class RadiusOTP(mfas.MFA):
def label(self) -> str: def label(self) -> str:
return gettext('OTP Code') return gettext('OTP Code')
def html(self, userId: str, request: 'ExtendedHttpRequest', username: str) -> str: def html(self, request: 'ExtendedHttpRequest', userId: str, username: str) -> str:
''' '''
ToDo: ToDo:
- Maybe create a field in mfa definition to edit from admin panel ? - Maybe create a field in mfa definition to edit from admin panel ?

View File

@ -398,7 +398,7 @@ class SMSMFA(mfas.MFA):
return gettext('MFA Code') return gettext('MFA Code')
def html(self, userId: str, request: 'ExtendedHttpRequest', username: str) -> str: def html(self, request: 'ExtendedHttpRequest', userId: str, username: str) -> str:
return gettext('Check your phone. You will receive an SMS with the verification code') return gettext('Check your phone. You will receive an SMS with the verification code')
def sendCode(self, request: 'ExtendedHttpRequest', userId: str, username: str, identifier: str, code: str) -> mfas.MFA.RESULT: def sendCode(self, request: 'ExtendedHttpRequest', userId: str, username: str, identifier: str, code: str) -> mfas.MFA.RESULT:

View File

@ -164,7 +164,7 @@ class TOTP_MFA(mfas.MFA):
self._userData(userId)[0], issuer=self.issuer.value, name=username self._userData(userId)[0], issuer=self.issuer.value, name=username
) )
def html(self, userId: str, request: 'ExtendedHttpRequest', username: str) -> str: def html(self, request: 'ExtendedHttpRequest', userId: str, username: str) -> str:
# Get data from storage related to this user # Get data from storage related to this user
secret, qrShown = self._userData(userId) secret, qrShown = self._userData(userId)
if qrShown: if qrShown:

View File

@ -300,7 +300,7 @@ def mfa(request: ExtendedHttpRequest) -> HttpResponse:
remember_device = _('{} hours').format(mfaProvider.remember_device) remember_device = _('{} hours').format(mfaProvider.remember_device)
# Html from MFA provider # Html from MFA provider
mfaHtml = mfaInstance.html(mfaUserId, request, request.user.name) mfaHtml = mfaInstance.html(request, mfaUserId, request.user.name)
# Redirect to index, but with MFA data # Redirect to index, but with MFA data
request.session['mfa'] = { request.session['mfa'] = {