jsoncreator_app/JSONCreator_iOS/JSONCreator/MF/ActionRegisterFidoHandler.swift
Matt Bruce f1bed66dc9 added for project testing
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-10-02 09:37:08 -05:00

40 lines
1.5 KiB
Swift

//
// ActionRegisterFidoHandler.swift
// MobileFirstFramework
//
// Created by Scott Pfeil on 6/12/23.
// Copyright © 2023 Verizon Wireless. All rights reserved.
//
import Foundation
import MVMCore
import LocalAuthentication
open class ActionRegisterFidoHandler: MVMCoreActionHandlerProtocol {
required public init() {}
public func execute(with model: MVMCore.ActionModelProtocol, delegateObject: MVMCore.DelegateObject?, additionalData: [AnyHashable : Any]?) async throws {
guard let model = model as? ActionRegisterFidoModel else { return }
do {
try await withCheckedThrowingContinuation({ continuation in
//MFFidoHelper.registerBiometric(model.fidoGuid, accessToken: model.accessToken, userIdentifier: model.userIdentifier) {
continuation.resume()
// } errorHandler: { error in
// continuation.resume(throwing: error)
// }
})
try await delegateObject?.actionDelegate?.action(with: model.onSuccess, additionalData: additionalData, delegateObject: delegateObject)
} catch {
let error = error as NSError
// guard error.code != FidoErrorCode.Canceled.rawValue,
// error.code != FidoErrorCode.SystemCanceled.rawValue,
// error.code != FidoErrorCode.UserNotResponsive.rawValue else {
// // Dont show error on this error codes
// return
// }
throw error
}
}
}