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:
@ -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.
|
||||||
|
@ -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
|
||||||
|
@ -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 ?
|
||||||
|
@ -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:
|
||||||
|
@ -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:
|
||||||
|
@ -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'] = {
|
||||||
|
Reference in New Issue
Block a user