Skip to content

Commit

Permalink
fix(app): Update acknowledge success function (#695)
Browse files Browse the repository at this point in the history
  • Loading branch information
talwinder kaur authored Dec 13, 2023
1 parent 9a84552 commit dc3f282
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ class OpenID4CI constructor(
return newInteraction.requireAcknowledgment()
}
fun acknowledgeSuccess() {
return newInteraction.acknowledgment().success()
val serializedStateResp = newInteraction.acknowledgment().serialize()
val acknowledgement = Acknowledgment(serializedStateResp)
return acknowledgement.success()
}
fun acknowledgeReject() {
return newInteraction.acknowledgment().reject()
Expand Down
15 changes: 14 additions & 1 deletion demo/app/ios/Runner/OpenID4CI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,20 @@ public class OpenID4CI {
}

func acknowledgeSuccess() throws {
return try initiatedInteraction.acknowledgment().success()
var error: NSError?
let serializedStateResp = try initiatedInteraction.acknowledgment().serialize(&error)
if let actualError = error {
print("error from acknowledge success", actualError.localizedDescription)
throw actualError
}

let acknowledgement = try Openid4ciNewAcknowledgment(serializedStateResp, &error)
if let actualError = error {
print("error from new acknowledgement", actualError.localizedDescription)
throw actualError
}

try acknowledgement?.success()
}

func acknowledgeReject() throws {
Expand Down

0 comments on commit dc3f282

Please sign in to comment.