Files
inventory-plus-plus/templates/pages/index.html.tmpl
T
angelandClaude Sonnet 5 ede7555d43
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
Tests / Go tests (push) Successful in 13s
auth: split dev-mode auth constructor and wire up dev-login/logout UI
Squeamish about New()'s empty-domain-string sentinel for "dev mode, skip
OIDC discovery" - split into New (always makes a real OIDC discovery
call, all params required) and NewDev (no ctx/domain/credentials at all,
since none are used). main.go now branches on cfg.DevAuthEnabled to pick
the right constructor instead of main.go/config.go coordinating on when
it's safe to pass empty strings.

Also finishes out the dev-auth flow this enables: config.Load reads a
DEV_AUTH_ENABLED-aware env file and only requires Auth0 vars when dev
auth is off; a PORT config var replaces the hardcoded :8082; and the nav
UI (layout/index templates, ui router) points login/logout links at
/api/auth/dev-login and a new /api/auth/dev-logout route when dev auth
is enabled, so the whole login/logout loop works locally without a real
Auth0 app.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-20 00:36:55 -06:00

40 lines
1.0 KiB
Cheetah

{{- $loggedIn := and (and .Identity .Identity.AccessToken) true -}}
{{- $devAuthEnabled := .DevAuthEnabled }}
<section class="flex justify-center max-w-full mt-[3em] mb-[3em]">
<h1 class="
min-[400px]:px-[calc(10vw-0.5em)]
min-[400px]:py-[calc(8vw-0.5em)]
border-[1px] border-sidebar-border rounded-lg
bg-card
text-nowrap
text-center
">
Inventory++
</h1>
</section>
<section class="flex flex-col items-center max-w-full mt-[1em] mb-[1em] gap-y-[2em]">
<p class="text-lg text-center max-w-[50%]">
Synchronize inventory automatically!
</p>
<div class="border-button border-sidebar-border bg-card text-lg text-center max-w-[50%]">
{{- if $loggedIn }}
<a hx-post="/api/accounts" hx-target="body" class="block p-[1em] font-bold">
Create an Account
</a>
{{- else }}
<a href="/api/auth/{{if $devAuthEnabled}}dev-login{{else}}login{{end}}" hx-boost="false" class="block p-[1em] font-bold">
New Login
</a>
{{- end }}
</div>
<p class="text-lg text-center max-w-[50%]">
...and start syncing your shops today!
</p>
</section>