From a73fa3cbf6fcbb713bb79a4c555086e69269ccdb Mon Sep 17 00:00:00 2001 From: fufesou <13586388+fufesou@users.noreply.github.com> Date: Thu, 15 May 2025 09:06:37 +0800 Subject: [PATCH] refact: oidc, launch url (#11772) Signed-off-by: fufesou --- flutter/lib/common.dart | 1 + flutter/lib/common/widgets/login.dart | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 3088b3f2a..c2641c929 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -2878,6 +2878,7 @@ Future canBeBlocked() async { return access_mode == 'view' || (access_mode.isEmpty && !option); } +// to-do: web not implemented Future shouldBeBlocked(RxBool block, WhetherUseRemoteBlock? use) async { if (use != null && !await use()) { block.value = false; diff --git a/flutter/lib/common/widgets/login.dart b/flutter/lib/common/widgets/login.dart index 13e589d87..c1f18f0a8 100644 --- a/flutter/lib/common/widgets/login.dart +++ b/flutter/lib/common/widgets/login.dart @@ -166,10 +166,13 @@ class _WidgetOPState extends State { final String stateMsg = resultMap['state_msg']; String failedMsg = resultMap['failed_msg']; final String? url = resultMap['url']; + final bool urlLaunched = (resultMap['url_launched'] as bool?) ?? false; final authBody = resultMap['auth_body']; if (_stateMsg != stateMsg || _failedMsg != failedMsg) { if (_url.isEmpty && url != null && url.isNotEmpty) { - launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication); + if (!urlLaunched) { + launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication); + } _url = url; } if (authBody != null) {