//
// Copyright © 2024 Nevis Security AG. All rights reserved.
//

import NevisMobileAuthentication

struct PasswordChangeMethodHandler: MethodHandler {
	func execute(using client: MobileAuthenticationClient, with message: ChannelInMessage) {
		let message: PasswordChangeMessage = validate(message: message)
		let operation = PasswordChangeOperation(operationId: message.operationId)
		OperationCache.shared.put(operation, using: message.operationId)

		client.operations.passwordChange
			.configure(by: message, operation: operation)
			.execute()
	}
}
