♻️ Rework of the oidc login flow (wip)

This commit is contained in:
2025-11-16 17:07:34 +08:00
parent 4b03b45a0d
commit 4ec10ceb47
4 changed files with 281 additions and 42 deletions

View File

@@ -8,6 +8,7 @@ import 'package:island/pods/activity/activity_rpc.dart';
import 'package:island/pods/websocket.dart';
import 'package:island/route.dart';
import 'package:island/screens/tray_manager.dart';
import 'package:island/services/event_bus.dart';
import 'package:island/services/notify.dart';
import 'package:island/services/sharing_intent.dart';
import 'package:island/services/update_service.dart';
@@ -115,6 +116,18 @@ class _AppWrapperState extends ConsumerState<AppWrapper>
}
void _handleDeepLink(Uri uri, WidgetRef ref) {
// Special handling for OIDC auth callback
if (uri.path == '/auth/callback' &&
uri.queryParameters.containsKey('challenge')) {
final challenge = uri.queryParameters['challenge']!;
eventBus.fire(OidcAuthCallbackEvent(challenge));
if (!kIsWeb &&
(Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
windowManager.show();
}
return;
}
final router = ref.read(routerProvider);
String path = '/${uri.host}${uri.path}';
if (uri.queryParameters.isNotEmpty) {