Skip to content

Commit

Permalink
Update Duo to be a class, so it can be mutated
Browse files Browse the repository at this point in the history
  • Loading branch information
mikenachbaur-okta committed Nov 24, 2023
1 parent 45b68db commit 57ca1b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion Sources/OktaIdx/Capabilities/IDXDuoCapability.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

extension Capability {
/// Capability to access data related to Duo
public struct Duo: AuthenticatorCapability {
public class Duo: AuthenticatorCapability {
public let host: String
public let signedToken: String
public let script: String
Expand All @@ -27,5 +27,12 @@ extension Capability {

signatureField.value = signatureData
}

init(host: String, signedToken: String, script: String, signatureData: String? = nil) {
self.host = host
self.signedToken = signedToken
self.script = script
self.signatureData = signatureData
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ extension Capability.OTP {
}

extension Capability.Duo {
init?(flow: InteractionCodeFlowAPI, ion authenticators: [IonAuthenticator]) {
convenience init?(flow: InteractionCodeFlowAPI, ion authenticators: [IonAuthenticator]) {
// Exit early if none of the authenticators have a "duo" method
let methods = methodTypes(from: authenticators)
guard methods.contains(.duo) else {
Expand Down

0 comments on commit 57ca1b7

Please sign in to comment.