using IdentityModel.OidcClient.Browser; using PostIt.Services; namespace PostIt.Desktop; /// /// One-shot platform bootstrap. Called from Program.Main so that /// the shared LoginPageViewModel sees a working IBrowser /// (the loopback listener that captures the OIDC redirect) without /// referencing any platform-specific API from the shared library. /// internal static class PlatformBootstrap { private static int _initialized; internal static void EnsureInitialized() { if (System.Threading.Interlocked.Exchange(ref _initialized, 1) != 0) return; Platform.DefaultRedirectUri = Settings.DefaultLoopbackRedirectUri; Platform.CreateBrowser = () => new LoopbackBrowser(); } }