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

import NevisMobileAuthentication

struct PasswordEnrollMethodHandler: UserInteractionMethodHandler {
	func execute(using _: MobileAuthenticationClient, with message: ChannelInMessage, operation: UserInteractionOperation) {
		let message: PasswordEnrollMessage = validate(message: message)
		let state: PasswordEnrollState = validate(state: operation.state)
		state.enroll(password: message.password)
		MethodChannelHandler.shared.resolve(method: .passwordEnroll)
	}
}
