The previous commit set Platform.CreateBrowser to null on the desktop side, so LoginAsync would still fail with 'No browser is available'. Close that loop with an explicit desktop bootstrap. PostIt.Desktop/PlatformBootstrap.cs mirrors the Android side: it populates Platform.DefaultRedirectUri and Platform.CreateBrowser once at startup. Program.Main calls EnsureInitialized before BuildAvaloniaApp so the LoginPageViewModel sees a working browser before any login attempt. The Yavsc.Org seed now reads Site:ExternalUrl from configuration so the RedirectUri list for the PostIt client follows the same setting as the rest of the application (same value used in Administration/ClientController, AccountController, etc.). Without this, an embedded 'launch PostIt from a Yavsc.Org page' scenario would be rejected by IdentityServer (redirect_uri mismatch). BuildPostItRedirectUris is a small helper that yields the constant PostItRedirectUris (loopback + Android custom scheme) followed by Site:ExternalUrl when set. Both SeedNewPostItClient (fresh db) and MigratePostItClientToPublic (existing db) consume it. The legacy cleanup block (which used to remove https://yavsc.pschneider.fr/ and yavsc://callback) is dropped: Site:ExternalUrl is now the canonical way to authorise that path and may legitimately equal that value.
28 lines
No EOL
787 B
C#
28 lines
No EOL
787 B
C#
using System;
|
|
using Avalonia;
|
|
|
|
namespace PostIt.Desktop;
|
|
|
|
sealed class Program
|
|
{
|
|
// Initialization code. Don't use any Avalonia, third-party APIs or any
|
|
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
|
|
// yet and stuff might break.
|
|
[STAThread]
|
|
public static void Main(string[] args)
|
|
{
|
|
PlatformBootstrap.EnsureInitialized();
|
|
BuildAvaloniaApp()
|
|
.StartWithClassicDesktopLifetime(args);
|
|
}
|
|
|
|
// Avalonia configuration, don't remove; also used by visual designer.
|
|
public static AppBuilder BuildAvaloniaApp()
|
|
=> AppBuilder.Configure<App>()
|
|
.UsePlatformDetect()
|
|
#if DEBUG
|
|
.WithDeveloperTools()
|
|
#endif
|
|
.WithInterFont()
|
|
.LogToTrace();
|
|
} |