From fd05f642d8e928de81b5bddc5ee484d77bdec42a Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Wed, 10 Feb 2021 13:33:01 +0100 Subject: [PATCH] feat: Implement cancel uiarequest --- lib/src/utils/uia_request.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/src/utils/uia_request.dart b/lib/src/utils/uia_request.dart index 8f66b380..569759bd 100644 --- a/lib/src/utils/uia_request.dart +++ b/lib/src/utils/uia_request.dart @@ -88,6 +88,12 @@ class UiaRequest { Future completeStage(AuthenticationData auth) => _run(auth); + /// Cancel this uia request for example if the app can not handle this stage. + void cancel([Exception err]) { + error = err ?? Exception('Request has been canceled'); + state = UiaRequestState.fail; + } + Set getNextStages( List flows, List completed) { final nextStages = {};