chore: Sanitize hash param for oidc

This commit is contained in:
Christian Kußowski 2026-02-22 12:27:58 +01:00
parent bed0a89d65
commit bfbcd31f35
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652

View file

@ -1,6 +1,7 @@
import 'dart:isolate';
import 'dart:ui';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:collection/collection.dart';
@ -8,6 +9,7 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:flutter_vodozemac/flutter_vodozemac.dart' as vod;
import 'package:matrix/matrix.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:universal_html/universal_html.dart' as web;
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/utils/client_manager.dart';
@ -30,6 +32,14 @@ void main() async {
await waitForPushIsolateDone();
}
// Sanitize hash for OIDC:
if (kIsWeb) {
final hash = web.window.location.hash;
if (hash.isNotEmpty && !hash.startsWith('/')) {
web.window.location.hash = hash.replaceFirst('#', '#?');
}
}
// Our background push shared isolate accesses flutter-internal things very early in the startup proccess
// To make sure that the parts of flutter needed are started up already, we need to ensure that the
// widget bindings are initialized already.