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:
 | 
					      tags:
 | 
				
			||||||
        - MFA
 | 
					        - MFA
 | 
				
			||||||
      summary: Disable multi-factor authentication for you or another user
 | 
					      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
 | 
					      operationId: mfaTotpDisable
 | 
				
			||||||
      requestBody:
 | 
					      requestBody:
 | 
				
			||||||
        required: false
 | 
					        required: false
 | 
				
			||||||
 | 
				
			|||||||
@ -107,10 +107,11 @@ def disable_mfa(email, mfa_id, env):
 | 
				
			|||||||
	if mfa_id is None:
 | 
						if mfa_id is None:
 | 
				
			||||||
		# Disable all MFA for a user.
 | 
							# Disable all MFA for a user.
 | 
				
			||||||
		return mfa_totp.disable(user, None, env)
 | 
							return mfa_totp.disable(user, None, env)
 | 
				
			||||||
 | 
					 | 
				
			||||||
	elif mfa_id.startswith("totp:"):
 | 
						elif mfa_id.startswith("totp:"):
 | 
				
			||||||
		# Disable a particular MFA mode for a user.
 | 
							# Disable a particular MFA mode for a user.
 | 
				
			||||||
		return mfa_totp.disable(user, mfa_id, env)
 | 
							return mfa_totp.disable(user, mfa_id, env)
 | 
				
			||||||
 | 
						else:
 | 
				
			||||||
 | 
							return False
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
def validate_auth_mfa(email, request, env):
 | 
					def validate_auth_mfa(email, request, env):
 | 
				
			||||||
	# Validates that a login request satisfies any MFA modes
 | 
						# Validates that a login request satisfies any MFA modes
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user