Files
uptimesebi/internal/web/auth.templ
T
Sebastian UnterschützandClaude Opus 5.5 db44fedc72 feat(api): add signup, login with totp and account security pages
Signup is limited to the first user by default (UPTIME_SIGNUP). TOTP
secrets are sealed with UPTIME_SECRET_KEYS and bound to the user id.

Closes #3
Closes #5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
2026-11-21 23:55:23 +01:00

38 lines
1.3 KiB
Templ
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package web
templ Login(p Page, signupAllowed bool) {
@authShell(p, "Anmelden") {
<form data-api="/auth/login" data-next="/">
@formError()
<div data-step="password">
@field("E-Mail", "email", "email", "username", true)
@field("Passwort", "password", "password", "current-password", true)
</div>
<div data-step="totp" hidden>
<p class="mb-4 text-sm text-muted">Code aus der Authenticator-App eingeben.</p>
@field("Code", "code", "text", "one-time-code", false)
</div>
@submit("Weiter")
</form>
if signupAllowed {
<p class="mt-8 text-sm text-muted">Noch kein Konto? <a class="text-ink underline underline-offset-2" href="/signup">Registrieren</a></p>
}
}
}
templ Signup(p Page) {
@authShell(p, "Konto anlegen") {
<form data-api="/auth/signup" data-next="/">
@formError()
@field("Name", "display_name", "text", "name", false)
@field("E-Mail", "email", "email", "username", true)
@field("Passwort (min. 12 Zeichen)", "password", "password", "new-password", true)
<hr class="my-6 border-rule"/>
@field("Organisation", "org_name", "text", "organization", true)
@field("Kurzname (a–z, 0–9, -)", "org_slug", "text", "off", true)
@submit("Anlegen")
</form>
<p class="mt-8 text-sm text-muted"><a class="text-ink underline underline-offset-2" href="/login">Zur Anmeldung</a></p>
}
}