mirror of
				https://github.com/mail-in-a-box/mailinabox.git
				synced 2025-11-03 19:30:54 +00:00 
			
		
		
		
	merge from upstream
This commit is contained in:
		
							parent
							
								
									a7370beae0
								
							
						
					
					
						commit
						d1110c4c02
					
				@ -1734,7 +1734,7 @@ paths:
 | 
			
		||||
      tags:
 | 
			
		||||
        - MFA
 | 
			
		||||
      summary: Disable multi-factor authentication for you or another user
 | 
			
		||||
      description: Disables multi-factor authentication for the currently logged-in admin user or another user if a 'user' parameter is subimtted. Either disables all multi-factor authentication methods or the method corresponding to the optional property `mfa_id`.
 | 
			
		||||
      description: Disables multi-factor authentication for the currently logged-in admin user or another user if a 'user' parameter is submitted. Either disables all multi-factor authentication methods or the method corresponding to the optional property `mfa_id`.
 | 
			
		||||
      operationId: mfaTotpDisable
 | 
			
		||||
      requestBody:
 | 
			
		||||
        required: false
 | 
			
		||||
 | 
			
		||||
@ -107,10 +107,11 @@ def disable_mfa(email, mfa_id, env):
 | 
			
		||||
	if mfa_id is None:
 | 
			
		||||
		# Disable all MFA for a user.
 | 
			
		||||
		return mfa_totp.disable(user, None, env)
 | 
			
		||||
 | 
			
		||||
	elif mfa_id.startswith("totp:"):
 | 
			
		||||
		# Disable a particular MFA mode for a user.
 | 
			
		||||
		return mfa_totp.disable(user, mfa_id, env)
 | 
			
		||||
	else:
 | 
			
		||||
		return False
 | 
			
		||||
			
 | 
			
		||||
def validate_auth_mfa(email, request, env):
 | 
			
		||||
	# Validates that a login request satisfies any MFA modes
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user