added support for 2fa login with browser flow
This commit is contained in:
@@ -18,6 +18,7 @@ import '../state/app/modules/app_modules.dart';
|
||||
import '../state/app/modules/chat/bloc/chat_bloc.dart';
|
||||
import '../state/app/modules/chat_list/bloc/chat_list_bloc.dart';
|
||||
import '../state/app/modules/marianum_message/bloc/marianum_message_state.dart';
|
||||
import '../view/login/nextcloud_login_flow_page.dart';
|
||||
import '../view/pages/files/files.dart';
|
||||
import '../view/pages/files/sharing/sharee_picker_page.dart';
|
||||
import '../view/pages/foreign_timetable/element_picker_page.dart';
|
||||
@@ -114,6 +115,20 @@ class AppRoutes {
|
||||
);
|
||||
}
|
||||
|
||||
/// Runs the Nextcloud Login Flow v2 (browser login, e.g. for accounts with
|
||||
/// two-factor authentication) and resolves to `true` once an app password
|
||||
/// was adopted. Used from the login flow and the settings "reconnect"
|
||||
/// action.
|
||||
static Future<bool> openNextcloudLoginFlow(BuildContext context) async {
|
||||
final result = await Navigator.of(context).push<bool>(
|
||||
MaterialPageRoute(
|
||||
fullscreenDialog: true,
|
||||
builder: (_) => const NextcloudLoginFlowPage(),
|
||||
),
|
||||
);
|
||||
return result ?? false;
|
||||
}
|
||||
|
||||
/// Opens the tappable, zoomable profile-picture viewer for [id].
|
||||
static void openLargeProfilePicture(BuildContext context, String id) {
|
||||
Navigator.of(context).push(
|
||||
|
||||
Reference in New Issue
Block a user