feature: Deprecated authwebview and use platform browser

This commit is contained in:
Christian Pauly 2021-02-01 11:47:33 +01:00
commit 4e5e3a80d6
5 changed files with 33 additions and 82 deletions

View file

@ -20,6 +20,7 @@ import 'package:future_loading_dialog/future_loading_dialog.dart';
import 'package:provider/provider.dart';
import 'package:universal_html/prefer_universal/html.dart' as html;
import 'package:http/http.dart' as http;
import 'package:url_launcher/url_launcher.dart';
/*import 'package:fluffychat/views/chat.dart';
import 'package:fluffychat/app_config.dart';
import 'package:dbus/dbus.dart';
@ -159,13 +160,21 @@ class MatrixState extends State<Matrix> {
),
);
default:
await widget.apl.currentState.pushNamed(
'/authwebview/$stage/${uiaRequest.session}',
arguments: () => null,
);
return uiaRequest.completeStage(
AuthenticationData(session: uiaRequest.session),
await launch(
Matrix.of(context).client.homeserver.toString() +
'/_matrix/client/r0/auth/$stage/fallback/web?session=${uiaRequest.session}',
);
if (OkCancelResult.ok ==
await showOkCancelAlertDialog(
message: L10n.of(context).pleaseFollowInstructionsOnWeb,
context: context,
okLabel: L10n.of(context).next,
cancelLabel: L10n.of(context).cancel,
)) {
return uiaRequest.completeStage(
AuthenticationData(session: uiaRequest.session),
);
}
}
}