Commit graph

4 commits

Author SHA1 Message Date
2263311e1b a simpler UI 2026-06-21 04:32:44 +01:00
9e190e3d3d postit: point Register button at /Account/Register
/signin only renders the local-account sign-in form on Yavsc.Org;
new accounts live at /Account/Register. Update RegisterUrl in
LoginPageViewModel and the matching test accordingly.
2026-06-21 03:03:56 +01:00
36e179c494 postit: link to register and forgot-password from LoginPage
The Yavsc.Org sign-in page and the password-reset page are the
canonical entry points for new users and locked-out users; expose
both from PostIt's LoginPage by deriving their URLs from the
configured Authentication.Authority.

* Add RegisterUrl, ForgotPasswordUrl, HasXxxUrl, ConfigMissing and
  ConfigMissingMessage to LoginPageViewModel.
* LoginPage loads settings eagerly in the VM ctor so the URLs are
  populated when XAML bindings first fire.
* Two new buttons (Register a new account, Forgot password?) bind to
  HasXxxUrl via IsEnabled and fall back to Process.Start on click.
* A yellow banner surfaces when Authentication.Authority is empty,
  pointing the user at ~/.config/PostIt/postit-settings.json.

Also drop the duplicated OIDC login logic from LoginPage.axaml.cs:
the page now drives Login through LoginPageViewModel.LoginAsync and
DataContext is auto-attached when HomePage pushes the page without
a VM.

Tests cover the happy-path OIDC flow, URL derivation, and the
ConfigMissing flag.
2026-06-20 21:49:32 +01:00
c411445699 postit: test LoginPageViewModel against an in-memory OIDC authority
Add a stubbed OIDC authority (discovery, jwks, /connect/token,
/connect/userinfo) and a fake IBrowser, then cover the full
authorization-code + PKCE flow in LoginPageViewModelTests.

The new LoginPageViewModel(Settings, Func<IBrowser?>) constructor
plus the BrowserFactoryOverride property keep production wiring
unchanged: the existing parameterless ctor and the platform
projects' Platform.CreateBrowser still drive runtime.
2026-06-20 20:52:00 +01:00