decided in favor of dedicated COMPONENT() macro, updates to documentation

This commit is contained in:
udo
2026-04-19 11:34:03 +00:00
parent be514d63d6
commit 2b5586d7df
56 changed files with 926 additions and 401 deletions
@@ -4,10 +4,11 @@ RENDER(Request& context)
{
starter_boot(context);
context.var["starter"]["page_title"] = "Login";
StarterUser users(context);
DTree result;
if(context.params["REQUEST_METHOD"] == "POST")
{
result = starter_user_sign_in(context.post["email"], context.post["password"], context);
result = users.sign_in(context.post["email"], context.post["password"]);
if(result["result"].to_string() != "")
{
starter_redirect("account/profile", context);
@@ -3,6 +3,6 @@
RENDER(Request& context)
{
starter_boot(context);
starter_user_logout(context);
StarterUser(context).logout();
starter_redirect("account/login", context);
}
@@ -3,13 +3,14 @@
RENDER(Request& context)
{
starter_boot(context);
if(!starter_is_signed_in(context))
StarterUser users(context);
if(!users.is_signed_in())
{
starter_redirect("account/login", context);
return;
}
context.var["starter"]["page_title"] = "Profile";
DTree user = starter_current_user(context);
DTree user = users.current();
String roles = "";
user["roles"].each([&](DTree role, String key) {
if(roles != "")
@@ -4,9 +4,10 @@ RENDER(Request& context)
{
starter_boot(context);
context.var["starter"]["page_title"] = "Register";
StarterUser users(context);
DTree result;
if(context.params["REQUEST_METHOD"] == "POST")
result = starter_user_create(context.post["email"], context.post["password"], context);
result = users.create(context.post["email"], context.post["password"]);
<>
<h1>Register</h1>