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

import NevisMobileAuthentication

struct CancelMethodHandler: MethodHandler {
	func execute(using _: MobileAuthenticationClient, method: ReactMethod, with message: ChannelInMessage) async {
		let message: CancelMessage = validate(message: message)
		await OperationCache.shared.cancel(by: message.operationId)
		MethodChannelHandler.shared.resolve(method: method)
	}
}
