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

import NevisMobileAuthentication

struct PinVerifyMethodHandler: UserInteractionMethodHandler {
	func execute(using _: MobileAuthenticationClient, with message: ChannelInMessage, operation: UserInteractionOperation) {
		let message: PinVerifyMessage = validate(message: message)
		let state: VerifyUserState = validate(state: operation.state)
		state.verify(pin: message.pin)
		MethodChannelHandler.shared.resolve(method: .pinVerify)
	}
}
