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

import NevisMobileAuthentication

struct AuthenticatorAaidMethodHandler: UserInteractionMethodHandler {
	func execute(using _: MobileAuthenticationClient, method: ReactMethod, with message: ChannelInMessage, operation: any UserInteractionOperation) async {
		let message: AuthenticatorAaidMessage = validate(message: message)
		let state: SelectAuthenticatorState = await validate(state: operation.state)
		await state.selectAuthenticator(aaid: message.aaid)
		MethodChannelHandler.shared.resolve(method: method)
	}
}
