| 1234567891011121314151617181920212223242526272829 |
- using Spry;
- using Spry.Authentication;
- using Statum;
- namespace ClankerSaddle {
- /** Public data of the login page's `page` slot. */
- public class LoginPagePublic : Object {
- public Statum.Model.ActionDto login { get; set; }
- }
- /**
- * Entrypoint for /login: hydrates the page slot with the
- * {@link LoginAction} reference; authenticated visitors are sent
- * straight to the dashboard.
- */
- public class LoginEntrypoint : StatumEntrypoint {
- public override async DirectiveBuilder handle() throws GLib.Error {
- if (!SpryAuth.current(request).is_anonymous) {
- return directives().navigate("/");
- }
- var page = new LoginPagePublic();
- page.login = action_registry.author<LoginAction>();
- return directives().set_typed<LoginPagePublic>("page", Scope.PAGE, page);
- }
- }
- }
|