Merge branch 'krille/uia-cancel' into 'main'

feat: Implement cancel uiarequest

See merge request famedly/famedlysdk!644
This commit is contained in:
Marcus 2021-02-10 12:46:10 +00:00
commit ff04b1cce5
1 changed files with 6 additions and 0 deletions

View File

@ -88,6 +88,12 @@ class UiaRequest<T> {
Future<T> completeStage(AuthenticationData auth) => _run(auth); Future<T> 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<String> getNextStages( Set<String> getNextStages(
List<AuthenticationFlow> flows, List<String> completed) { List<AuthenticationFlow> flows, List<String> completed) {
final nextStages = <String>{}; final nextStages = <String>{};