Skip to content

Commit

Permalink
TW-702: Fix auto close webview when login sso success in android
Browse files Browse the repository at this point in the history
  • Loading branch information
nqhhdev authored and hoangdat committed Oct 26, 2023
1 parent a31a85f commit 1b94e34
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/pages/connect/connect_page_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/widgets/matrix.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_web_auth/flutter_web_auth.dart';
import 'package:flutter_web_auth_2/flutter_web_auth_2.dart';
import 'package:future_loading_dialog/future_loading_dialog.dart';
import 'package:matrix/matrix.dart';
import 'package:universal_html/html.dart' as html;
Expand Down Expand Up @@ -69,9 +69,12 @@ mixin ConnectPageMixin {
redirectUrl: redirectUrl,
);
final urlScheme = _getRedirectUrlScheme(redirectUrl);
final result = await FlutterWebAuth.authenticate(
final result = await FlutterWebAuth2.authenticate(
url: url,
callbackUrlScheme: urlScheme,
options: const FlutterWebAuth2Options(
intentFlags: ephemeralIntentFlags,
),
);
final token = Uri.parse(result).queryParameters['loginToken'];
if (token?.isEmpty ?? false) return;
Expand All @@ -94,7 +97,7 @@ mixin ConnectPageMixin {

final urlScheme = _getRedirectUrlScheme(redirectUrl);
try {
final result = await FlutterWebAuth.authenticate(
final result = await FlutterWebAuth2.authenticate(
url: url,
callbackUrlScheme: urlScheme,
);
Expand Down

0 comments on commit 1b94e34

Please sign in to comment.