feat: terms of service and versioned consent; data rights for every account
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 9m21s
ci / test (pull_request) Successful in 13m53s
ci / build (pull_request) Successful in 11m22s
ci / image (pull_request) Successful in 4m36s

Terms of service join the legal notice and privacy policy, for the
platform only. Every account accepts the platform's privacy policy and
terms: on sign-up (also through an invitation) by ticking a box for the
versions shown, and after a sign-in through a provider right away. When
an admin saves a material change with "everyone has to accept again",
the document gets a new version and each account is asked at its next
request; corrections ask nobody. Acceptances are kept per version with
their time, as proof, and are part of the data export.

Until an account accepted, and while it is suspended, it can read the
documents, export its data, delete itself and sign out, nothing else:
pages lead to /consent or /account/suspended, other API calls answer 403
consent_required or account_suspended. Suspended accounts therefore sign
in again, by password or provider; their API tokens stay blocked.

Deleting an account deletes the organizations it owns, monitors and all,
also when they have other members (each organization has one owner); it
no longer refuses. The account settings name those organizations first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-23 22:26:20 +01:00
1 parent 61fdfa830a
commit 8d7c1f856c
38 files changed
+2027 -348

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@ It is built for teams and hosting providers: organizations with members, roles a
- **History:** charts and SLA from one hour to a year, per region; see what the checker saw (redirect chain, timing, certificate, response body). - **History:** charts and SLA from one hour to a year, per region; see what the checker saw (redirect chain, timing, certificate, response body).
- **Status pages:** unlimited, custom domains with automatic TLS, themes, Markdown, legal notice; served from cache during outages. - **Status pages:** unlimited, custom domains with automatic TLS, themes, Markdown, legal notice; served from cache during outages.
- **Organizations:** members, custom roles scoped to monitor groups or status pages, API tokens, OpenID Connect SSO per organization, sign-up and sign-in with providers such as Google, Microsoft or GitHub, enforced 2FA, audit log. - **Organizations:** members, custom roles scoped to monitor groups or status pages, API tokens, OpenID Connect SSO per organization, sign-up and sign-in with providers such as Google, Microsoft or GitHub, enforced 2FA, audit log.
- **Privacy:** GDPR data export (JSON, PDF) and deletion, configurable retention, no telemetry. - **Privacy:** GDPR data export (JSON, PDF) and deletion, also for suspended accounts; legal notice, privacy policy and terms of service, with versioned consent on sign-up and again after material changes; configurable retention, no telemetry.
- **Operations:** three stateless binaries, horizontally scalable; TimescaleDB and Redis (Sentinel supported); OpenAPI documentation. - **Operations:** three stateless binaries, horizontally scalable; TimescaleDB and Redis (Sentinel supported); OpenAPI documentation.
## Installation ## Installation
+6 -3
View File
@@ -60,8 +60,11 @@ var endpoints = []endpoint{
{method: "GET", path: "/api/v1/me/export", tag: "Account", summary: "Export all personal data (GDPR Art. 15, 20)", {method: "GET", path: "/api/v1/me/export", tag: "Account", summary: "Export all personal data (GDPR Art. 15, 20)",
description: "`?format=pdf` returns a PDF instead of JSON.", resp: accountExport{}}, description: "`?format=pdf` returns a PDF instead of JSON.", resp: accountExport{}},
{method: "POST", path: "/api/v1/me/delete", tag: "Account", summary: "Delete the account (GDPR Art. 17)", sessionOnly: true, {method: "POST", path: "/api/v1/me/delete", tag: "Account", summary: "Delete the account (GDPR Art. 17)", sessionOnly: true,
description: "Refused with `owns_shared_orgs` while the user owns organizations with other members. Organizations only the user belongs to are deleted with the account.", description: "Organizations the user owns are deleted with the account, with all their monitors, even when they have other members. Open to suspended accounts and to those that have not accepted the terms.",
req: deletionRequest{}, resp: obj{"status": ""}}, req: deletionRequest{}, resp: obj{"status": ""}},
{method: "POST", path: "/api/v1/consent", tag: "Account", summary: "Accept the platform's privacy policy and terms", sessionOnly: true,
description: "`versions` are the versions shown, e.g. `privacy:12,terms:14`; `409 consent_outdated` when a document changed meanwhile. Until an account accepted the current versions, other requests of its sessions get `403 consent_required`.",
req: consentRequest{}, resp: obj{"redirect": ""}},
{method: "POST", path: "/api/v1/markdown/preview", tag: "Account", summary: "Render Markdown as pages will show it", {method: "POST", path: "/api/v1/markdown/preview", tag: "Account", summary: "Render Markdown as pages will show it",
req: previewRequest{}, resp: obj{"html": ""}}, req: previewRequest{}, resp: obj{"html": ""}},
{method: "POST", path: "/api/v1/invitations/:token/accept", tag: "Account", summary: "Accept an invitation with the signed-in account", sessionOnly: true, {method: "POST", path: "/api/v1/invitations/:token/accept", tag: "Account", summary: "Accept an invitation with the signed-in account", sessionOnly: true,
@@ -294,10 +297,10 @@ var endpoints = []endpoint{
perm: "platform admin", req: suspensionRequest{}, status: http.StatusNoContent}, perm: "platform admin", req: suspensionRequest{}, status: http.StatusNoContent},
{method: "DELETE", path: "/api/v1/admin/orgs/:id", tag: "Platform", summary: "Delete an organization with all its data", perm: "platform admin", status: http.StatusNoContent}, {method: "DELETE", path: "/api/v1/admin/orgs/:id", tag: "Platform", summary: "Delete an organization with all its data", perm: "platform admin", status: http.StatusNoContent},
{method: "PUT", path: "/api/v1/admin/users/:id/suspension", tag: "Platform", summary: "Suspend or reinstate an account", {method: "PUT", path: "/api/v1/admin/users/:id/suspension", tag: "Platform", summary: "Suspend or reinstate an account",
description: "A suspended account is signed out everywhere and can neither sign in nor use its API tokens. Platform admins cannot be suspended.", description: "A suspended account is signed out everywhere and cannot use its API tokens; signing in again only lets it export or delete its data. Platform admins cannot be suspended.",
perm: "platform admin", req: suspensionRequest{}, status: http.StatusNoContent}, perm: "platform admin", req: suspensionRequest{}, status: http.StatusNoContent},
{method: "DELETE", path: "/api/v1/admin/users/:id", tag: "Platform", summary: "Delete an account", {method: "DELETE", path: "/api/v1/admin/users/:id", tag: "Platform", summary: "Delete an account",
description: "Organizations only the account belongs to are deleted with it; owning one shared with others gives 409 owns_shared_orgs. Platform admins cannot be deleted.", description: "Organizations the account owns are deleted with it. Platform admins cannot be deleted.",
perm: "platform admin", status: http.StatusNoContent}, perm: "platform admin", status: http.StatusNoContent},
{method: "GET", path: "/api/v1/admin/regions", tag: "Platform", summary: "List platform regions", perm: "platform admin", {method: "GET", path: "/api/v1/admin/regions", tag: "Platform", summary: "List platform regions", perm: "platform admin",
resp: obj{"regions": []regionView{}}}, resp: obj{"regions": []regionView{}}},
+1
View File
@@ -37,6 +37,7 @@ var auditActions = map[string]string{
"POST /api/v1/auth/login": "auth.login", "POST /api/v1/auth/login": "auth.login",
"POST /api/v1/auth/login/totp": "auth.login", "POST /api/v1/auth/login/totp": "auth.login",
"POST /api/v1/auth/logout": "auth.logout", "POST /api/v1/auth/logout": "auth.logout",
"POST /api/v1/consent": "account.consent",
"POST /api/v1/me/org": "", "POST /api/v1/me/org": "",
"POST /api/v1/me/totp/setup": "", "POST /api/v1/me/totp/setup": "",
"POST /api/v1/me/totp/enable": "account.totp_enable", "POST /api/v1/me/totp/enable": "account.totp_enable",
+16 -10
View File
@@ -35,6 +35,10 @@ type signupRequest struct {
// after confirming. // after confirming.
OrgName string `json:"org_name" binding:"max=200"` OrgName string `json:"org_name" binding:"max=200"`
OrgSlug string `json:"org_slug" binding:"max=63"` OrgSlug string `json:"org_slug" binding:"max=63"`
// Consent accepts the platform's privacy policy and terms in the
// versions the form showed (ConsentVersions, "privacy:12,terms:14").
Consent bool `json:"consent"`
ConsentVersions string `json:"consent_versions" binding:"max=200"`
} }
func (s *Server) signup(c *gin.Context) { func (s *Server) signup(c *gin.Context) {
@@ -60,6 +64,10 @@ func (s *Server) signup(c *gin.Context) {
fail(c, http.StatusTooManyRequests, "signup_limit") fail(c, http.StatusTooManyRequests, "signup_limit")
return return
} }
consent, ok := s.signupConsent(c, req.Consent, req.ConsentVersions)
if !ok {
return
}
verify := s.verificationRequired() verify := s.verificationRequired()
withOrg := !verify && strings.TrimSpace(req.OrgName) != "" && strings.TrimSpace(req.OrgSlug) != "" withOrg := !verify && strings.TrimSpace(req.OrgName) != "" && strings.TrimSpace(req.OrgSlug) != ""
hash, err := auth.HashPassword(req.Password) hash, err := auth.HashPassword(req.Password)
@@ -103,6 +111,11 @@ func (s *Server) signup(c *gin.Context) {
} }
return nil return nil
}) })
if err == nil {
err = s.db.Tx(ctx, tenant.User(user.ID), func(q *store.Queries) error {
return recordConsent(ctx, q, user.ID, consent)
})
}
switch { switch {
case isUniqueViolation(err, "users_email_key"), isUniqueViolation(err, "users_email_key_idx"): case isUniqueViolation(err, "users_email_key"), isUniqueViolation(err, "users_email_key_idx"):
fail(c, http.StatusConflict, "email_taken") fail(c, http.StatusConflict, "email_taken")
@@ -195,12 +208,9 @@ func (s *Server) login(c *gin.Context) {
invalidCredentials(c) invalidCredentials(c)
return return
} }
// Only someone who knows the password learns of the suspension or a // Only someone who knows the password learns of a missing
// missing confirmation. // confirmation. Suspended accounts sign in, but only to export or
if user.DisabledAt != nil { // delete their data.
fail(c, http.StatusForbidden, "account_suspended")
return
}
if user.EmailVerifiedAt == nil { if user.EmailVerifiedAt == nil {
fail(c, http.StatusForbidden, "email_unverified") fail(c, http.StatusForbidden, "email_unverified")
return return
@@ -289,10 +299,6 @@ func (s *Server) finishLogin(c *gin.Context, userID uuid.UUID, method auth.Metho
internalError(c, err) internalError(c, err)
return return
} }
if user.DisabledAt != nil {
fail(c, http.StatusForbidden, "account_suspended")
return
}
var org uuid.UUID var org uuid.UUID
if len(orgs) > 0 { if len(orgs) > 0 {
org = orgs[0].ID org = orgs[0].ID
+357
View File
@@ -0,0 +1,357 @@
package api
import (
"context"
"errors"
"fmt"
"net/http"
"net/url"
"slices"
"strconv"
"strings"
"github.com/gin-gonic/gin"
"github.com/google/uuid"
"git.zb-server.de/ZB-Server/uptimesebi/internal/auth"
"git.zb-server.de/ZB-Server/uptimesebi/internal/store"
"git.zb-server.de/ZB-Server/uptimesebi/internal/tenant"
"git.zb-server.de/ZB-Server/uptimesebi/internal/web"
)
// Every account accepts the platform's privacy policy and terms in their
// current version: on sign-up, and otherwise right after signing in, again
// whenever a document asks for it. Until then, and while an account is
// suspended, it can only read the documents, export its data, delete
// itself and sign out.
// requiredConsent returns the current version of each document accounts
// accept; empty when the platform has none.
func (s *Server) requiredConsent(ctx context.Context) (map[string]int64, error) {
return s.consent.get(ctx, s.rdb, func(ctx context.Context) (map[string]int64, error) {
out := map[string]int64{}
err := s.db.Tx(ctx, tenant.System(), func(q *store.Queries) error {
rows, err := q.RequiredLegalVersions(ctx)
for _, r := range rows {
out[r.Kind] = r.Version
}
return err
})
return out, err
})
}
// consentVersions encodes versions for a form, e.g. "privacy:12,terms:14".
func consentVersions(v map[string]int64) string {
var parts []string
for _, kind := range web.ConsentKinds {
if n, ok := v[kind]; ok {
parts = append(parts, kind+":"+strconv.FormatInt(n, 10))
}
}
return strings.Join(parts, ",")
}
func parseConsentVersions(s string) map[string]int64 {
out := map[string]int64{}
for part := range strings.SplitSeq(s, ",") {
kind, n, ok := strings.Cut(strings.TrimSpace(part), ":")
if v, err := strconv.ParseInt(n, 10, 64); ok && err == nil {
out[kind] = v
}
}
return out
}
// errConsentOutdated reports an acceptance of versions that are no longer
// current: a document changed while the form was open.
var errConsentOutdated = errors.New("api: consent for outdated documents")
// checkConsent verifies that accepted covers exactly the documents
// required right now.
func checkConsent(required, accepted map[string]int64) error {
for kind, v := range required {
if accepted[kind] != v {
return errConsentOutdated
}
}
return nil
}
func recordConsent(ctx context.Context, q *store.Queries, user uuid.UUID, versions map[string]int64) error {
for kind, v := range versions {
if err := q.AcceptLegal(ctx, store.AcceptLegalParams{UserID: user, Kind: kind, Version: v}); err != nil {
return err
}
}
return nil
}
// access is what an account may do in the console.
type access struct {
suspended bool
reason string
// missing are the documents still to accept, with their versions.
missing map[string]int64
}
func (a access) restricted() bool { return a.suspended || len(a.missing) > 0 }
func (s *Server) accessOf(ctx context.Context, user uuid.UUID) (access, error) {
required, err := s.requiredConsent(ctx)
if err != nil {
return access{}, err
}
var a access
err = s.db.Tx(ctx, tenant.User(user), func(q *store.Queries) error {
u, err := q.GetUser(ctx, user)
if err != nil {
return err
}
if u.DisabledAt != nil {
a.suspended, a.reason = true, u.DisabledReason
}
if len(required) == 0 {
return nil
}
accepted, err := q.AcceptedLegalVersions(ctx, user)
if err != nil {
return err
}
for kind, v := range required {
if !slices.ContainsFunc(accepted, func(r store.AcceptedLegalVersionsRow) bool { return r.Kind == kind && r.Version == v }) {
if a.missing == nil {
a.missing = map[string]int64{}
}
a.missing[kind] = v
}
}
return nil
})
return a, err
}
// restrictedPaths stay open to accounts that are suspended or have yet to
// accept the documents. Admins keep editing the documents, which they may
// be publishing one after the other; the handlers still check they are.
var restrictedPaths = []string{
"/consent", "/account/suspended", "/legal/",
"/api/v1/auth/", "/api/v1/consent", "/api/v1/me/export", "/api/v1/me/delete", "/api/v1/locale",
"/admin/legal", "/api/v1/admin/legal/",
}
func allowedRestricted(path string) bool {
return slices.ContainsFunc(restrictedPaths, func(p string) bool {
return path == p || (strings.HasSuffix(p, "/") && strings.HasPrefix(path, p))
})
}
// accountGate keeps restricted accounts on the consent or suspension page.
func (s *Server) accountGate() gin.HandlerFunc {
return func(c *gin.Context) {
sess := auth.Current(c)
path := c.Request.URL.Path
if sess == nil || allowedRestricted(path) {
c.Next()
return
}
a, err := s.accessOf(c.Request.Context(), sess.UserID)
switch {
case err != nil:
internalError(c, err)
c.Abort()
return
case !a.restricted():
c.Next()
return
}
if strings.HasPrefix(path, "/api/") {
code := "consent_required"
if a.suspended {
code = "account_suspended"
}
fail(c, http.StatusForbidden, code)
c.Abort()
return
}
target := "/account/suspended"
if !a.suspended {
target = "/consent?next=" + url.QueryEscape(c.Request.URL.RequestURI())
}
c.Redirect(http.StatusSeeOther, target)
c.Abort()
}
}
// localNext keeps a redirect target on this site.
func localNext(next string) string {
if !strings.HasPrefix(next, "/") || strings.HasPrefix(next, "//") || strings.HasPrefix(next, "/\\") {
return "/"
}
return next
}
type consentRequest struct {
// Versions are the documents accepted, as shown: "privacy:12,terms:14".
Versions string `json:"versions" binding:"max=200"`
Next string `json:"next" binding:"max=2000"`
}
// acceptConsent records that the signed-in account accepts the current
// documents.
func (s *Server) acceptConsent(c *gin.Context) {
var req consentRequest
if !bind(c, &req) {
return
}
sess := auth.Current(c)
if sess == nil {
fail(c, http.StatusUnauthorized, "unauthenticated")
return
}
ctx := c.Request.Context()
required, err := s.requiredConsent(ctx)
if err != nil {
internalError(c, err)
return
}
accepted := parseConsentVersions(req.Versions)
if err := checkConsent(required, accepted); err != nil {
fail(c, http.StatusConflict, "consent_outdated")
return
}
auditDetail(c, "versions", consentVersions(required))
if err := s.db.Tx(ctx, tenant.User(sess.UserID), func(q *store.Queries) error {
return recordConsent(ctx, q, sess.UserID, required)
}); err != nil {
internalError(c, err)
return
}
c.JSON(http.StatusOK, gin.H{"redirect": localNext(req.Next)})
}
// consentDocs lists the documents of versions with their links.
func (s *Server) consentDocs(ctx context.Context, versions map[string]int64) []web.LegalLink {
var docs []web.LegalLink
for _, l := range web.LegalLinks(s.platformLegalDocs(ctx), "/legal/") {
if _, ok := versions[l.Kind]; ok {
docs = append(docs, l)
}
}
return docs
}
// restrictedMe is the account data the consent and suspension pages show,
// with the organizations its deletion would take along.
func (s *Server) restrictedMe(c *gin.Context, sess *auth.Session) (web.Me, error) {
m, err := s.loadMe(c.Request.Context(), sess)
if err != nil {
return web.Me{}, err
}
me := toWebMe(m)
me.DeletesOrgs, err = s.ownedOrgs(c.Request.Context(), sess.UserID)
return me, err
}
func (s *Server) consentPage(c *gin.Context) {
sess := auth.Current(c)
if sess == nil {
c.Redirect(http.StatusSeeOther, "/login")
return
}
next := localNext(c.Query("next"))
a, err := s.accessOf(c.Request.Context(), sess.UserID)
if err != nil {
internalError(c, err)
return
}
if a.suspended {
c.Redirect(http.StatusSeeOther, "/account/suspended")
return
}
if len(a.missing) == 0 {
c.Redirect(http.StatusSeeOther, next)
return
}
me, err := s.restrictedMe(c, sess)
if err != nil {
internalError(c, err)
return
}
required, err := s.requiredConsent(c.Request.Context())
if err != nil {
internalError(c, err)
return
}
web.Render(c, http.StatusOK, web.ConsentPage(s.pageFor(c, "consent.title"), me,
s.consentDocs(c.Request.Context(), a.missing), consentVersions(required), next))
}
func (s *Server) suspendedPage(c *gin.Context) {
sess := auth.Current(c)
if sess == nil {
c.Redirect(http.StatusSeeOther, "/login")
return
}
a, err := s.accessOf(c.Request.Context(), sess.UserID)
if err != nil {
internalError(c, err)
return
}
if !a.suspended {
c.Redirect(http.StatusSeeOther, "/")
return
}
me, err := s.restrictedMe(c, sess)
if err != nil {
internalError(c, err)
return
}
web.Render(c, http.StatusOK, web.SuspendedPage(s.pageFor(c, "suspended.title"), me, a.reason))
}
// signupConsent checks the consent given on a sign-up form and returns the
// versions to record.
func (s *Server) signupConsent(c *gin.Context, given bool, versions string) (map[string]int64, bool) {
required, err := s.requiredConsent(c.Request.Context())
if err != nil {
internalError(c, err)
return nil, false
}
if len(required) == 0 {
return nil, true
}
if !given {
fail(c, http.StatusUnprocessableEntity, "consent_required")
return nil, false
}
if err := checkConsent(required, parseConsentVersions(versions)); err != nil {
fail(c, http.StatusConflict, "consent_outdated")
return nil, false
}
return required, true
}
// signupConsentView is what sign-up forms show: the documents to accept
// and their versions.
func (s *Server) signupConsentView(ctx context.Context) (web.SignupConsent, error) {
required, err := s.requiredConsent(ctx)
if err != nil || len(required) == 0 {
return web.SignupConsent{}, err
}
return web.SignupConsent{Docs: s.consentDocs(ctx, required), Versions: consentVersions(required)}, nil
}
// ownedOrgs names the organizations user owns, which deleting the account
// deletes too.
func (s *Server) ownedOrgs(ctx context.Context, user uuid.UUID) ([]string, error) {
var out []string
err := s.db.Tx(ctx, tenant.System(), func(q *store.Queries) error {
owned, err := q.OwnedOrgs(ctx, user)
for _, o := range owned {
out = append(out, fmt.Sprintf("%s (%s)", o.Name, o.Slug))
}
return err
})
return out, err
}
+193
View File
@@ -0,0 +1,193 @@
package api_test
import (
"context"
"net/http"
"strings"
"testing"
"github.com/google/uuid"
"github.com/jackc/pgx/v5"
"git.zb-server.de/ZB-Server/uptimesebi/internal/sso/ssotest"
"git.zb-server.de/ZB-Server/uptimesebi/internal/store"
"git.zb-server.de/ZB-Server/uptimesebi/internal/tenant"
)
func TestConsent(t *testing.T) {
e := newEnv(t)
ctx := context.Background()
admin := e.browser(t)
admin.signup("a@"+uniq("cs")+".test", uniq("cs-"))
if err := tenant.New(e.dbPool).Tx(ctx, tenant.Global(), func(q *store.Queries) error {
return q.MakeAdmin(ctx, admin.userIDSelf())
}); err != nil {
t.Fatal(err)
}
earlier := e.browser(t)
earlier.signup("e@"+uniq("cs")+".test", uniq("cs-"))
t.Cleanup(func() { clearPlatformLegal(admin) })
for kind, text := range map[string]string{"privacy": "# Datenschutz", "terms": "# AGB"} {
if st, body := admin.do("PUT", "/api/v1/admin/legal/"+kind, map[string]any{"markdown": text}); st != http.StatusNoContent {
t.Fatalf("set %s = %d %v", kind, st, body)
}
}
admin.acceptConsent()
if _, _, html := e.browser(t).page("/login"); !strings.Contains(html, `href="/legal/terms"`) {
t.Error("the footer lacks the terms")
}
if st, body := admin.do("PUT", "/api/v1/org/legal/terms", map[string]any{"markdown": "x"}); st != http.StatusNotFound {
t.Errorf("organization sets terms = %d %v, want 404", st, body)
}
// Signing up needs the box ticked for the versions shown.
visitor := e.browser(t)
_, _, form := visitor.page("/signup")
versions := consentShown(form)
if !strings.Contains(versions, "privacy:") || !strings.Contains(versions, "terms:") || !strings.Contains(form, `name="consent" required`) {
t.Fatalf("sign-up form lacks the consent box: versions %q", versions)
}
signup := func(consent bool, versions string) (int, map[string]any) {
return e.browser(t).do("POST", "/api/v1/auth/signup", map[string]any{
"email": uniq("n") + "@example.test", "password": password, "consent": consent, "consent_versions": versions,
})
}
st, body := signup(false, versions)
expect(t, "sign up without consent", st, body, http.StatusUnprocessableEntity, "consent_required")
st, body = signup(true, "privacy:1,terms:1")
expect(t, "sign up with outdated versions", st, body, http.StatusConflict, "consent_outdated")
email := uniq("n") + "@example.test"
fresh := e.browser(t)
if st, body := fresh.do("POST", "/api/v1/auth/signup", map[string]any{
"email": email, "password": password, "consent": true, "consent_versions": versions,
}); st != http.StatusOK {
t.Fatalf("sign up with consent = %d %v", st, body)
}
freshID := fresh.userIDSelf()
if n := e.count(t, `SELECT count(*) FROM legal_acceptances WHERE user_id = $1`, freshID); n != 2 {
t.Errorf("recorded %d acceptances, want 2", n)
}
if got := fresh.visit("/"); got.Path == "/consent" {
t.Error("an account that accepted on sign-up is asked again")
}
// Accounts from before have to accept first; until then they can read
// the documents, take their data along and sign out.
if got := earlier.visit("/"); got.Path != "/consent" || got.Query().Get("next") != "/" {
t.Errorf("console before consent landed on %s", got)
}
st, body = earlier.do("GET", "/api/v1/org/monitors", nil)
expect(t, "API before consent", st, body, http.StatusForbidden, "consent_required")
for _, path := range []string{"/legal/terms", "/api/v1/me/export"} {
if st, _, _ := earlier.page(path); st != http.StatusOK {
t.Errorf("GET %s before consent = %d", path, st)
}
}
_, _, page := earlier.page("/consent")
if !strings.Contains(page, "Delete account") || !strings.Contains(page, `href="/legal/terms"`) {
t.Error("the consent page offers no way out or lacks the documents")
}
st, body = earlier.do("POST", "/api/v1/consent", map[string]any{"versions": "terms:1", "next": "/"})
expect(t, "accept outdated versions", st, body, http.StatusConflict, "consent_outdated")
if st, body := earlier.do("POST", "/api/v1/consent", map[string]any{"versions": consentShown(page), "next": "//evil.example"}); st != http.StatusOK || body["redirect"] != "/" {
t.Errorf("accept = %d %v, want a local redirect", st, body)
}
if st, _ := earlier.do("GET", "/api/v1/org/monitors", nil); st != http.StatusOK {
t.Errorf("API after consent = %d", st)
}
// A correction asks nobody again; a new version asks everyone.
admin.do("PUT", "/api/v1/admin/legal/terms", map[string]any{"markdown": "# AGB\n\nTippfehler behoben"})
if got := earlier.visit("/"); got.Path == "/consent" {
t.Error("a correction asked for consent again")
}
admin.do("PUT", "/api/v1/admin/legal/terms", map[string]any{"markdown": "# AGB v2", "new_version": true})
if got := earlier.visit("/"); got.Path != "/consent" {
t.Errorf("a new version of the terms was not put before the account: %s", got)
}
if _, _, page := earlier.page("/consent"); !strings.Contains(page, `href="/legal/terms"`) || strings.Contains(page, `<li><a href="/legal/privacy"`) {
t.Error("the consent page should list only the changed terms")
}
earlier.acceptConsent()
admin.acceptConsent()
// An account created through a sign-in provider is asked right after
// its first sign-in.
idp := ssotest.New(t)
st, provider := admin.do("POST", "/api/v1/admin/identity-providers", map[string]any{
"kind": "oidc", "name": "IdP", "issuer": idp.Issuer(), "client_id": idp.ClientID, "client_secret": idp.Secret,
"allow_signup": true, "enabled": true,
})
if st != http.StatusCreated {
t.Fatalf("create provider = %d %v", st, provider)
}
t.Cleanup(func() {
_ = e.asSystem(t, func(tx pgx.Tx) error {
_, err := tx.Exec(ctx, `DELETE FROM platform_identity_providers WHERE id = $1`, provider["id"])
return err
})
})
idp.SetUser(ssotest.User{Subject: uniq("sub"), Email: uniq("sso") + "@example.test", EmailVerified: true})
viaSSO := e.browser(t)
if got := viaSSO.visit("/login/sso/" + provider["id"].(string)); got.Path != "/consent" {
t.Errorf("SSO sign-up landed on %s, want the consent page", got)
}
viaSSO.acceptConsent()
if got := viaSSO.visit("/"); got.Path != "/orgs/new" {
t.Errorf("after consenting the new SSO account landed on %s, want /orgs/new", got)
}
}
func TestSuspendedAccount(t *testing.T) {
e := newEnv(t)
ctx := context.Background()
admin := e.browser(t)
admin.signup("a@"+uniq("su")+".test", uniq("su-"))
if err := tenant.New(e.dbPool).Tx(ctx, tenant.Global(), func(q *store.Queries) error {
return q.MakeAdmin(ctx, admin.userIDSelf())
}); err != nil {
t.Fatal(err)
}
email := "s@" + uniq("su") + ".test"
user := e.browser(t)
user.signup(email, uniq("su-"))
userID := user.userIDSelf()
org := uuid.MustParse(user.orgID())
user.do("POST", "/api/v1/org/monitors", map[string]any{"name": "web", "type": "heartbeat", "interval_seconds": 3600})
_, tok := user.do("POST", "/api/v1/org/tokens", map[string]any{"name": "ci", "permissions": []string{"monitors.read"}})
if st, body := admin.do("PUT", "/api/v1/admin/users/"+userID.String()+"/suspension", map[string]any{"suspended": true, "reason": "Unpaid invoice"}); st != http.StatusNoContent {
t.Fatalf("suspend = %d %v", st, body)
}
api := &browser{t: t, base: user.base, hc: e.srv.Client(), bearer: tok["token"].(string)}
if st, _ := api.do("GET", "/api/v1/org/monitors", nil); st != http.StatusUnauthorized {
t.Errorf("API token of a suspended account = %d, want 401", st)
}
// It signs in again, but only to take its data along or delete itself.
back := e.browser(t)
if st, body := back.do("POST", "/api/v1/auth/login", map[string]any{"email": email, "password": password}); st != http.StatusOK {
t.Fatalf("suspended account signs in = %d %v", st, body)
}
if got := back.visit("/"); got.Path != "/account/suspended" {
t.Errorf("console of a suspended account landed on %s", got)
}
_, _, page := back.page("/account/suspended")
if !strings.Contains(page, "Unpaid invoice") || !strings.Contains(page, "Delete account") || !strings.Contains(page, "You own these organizations") {
t.Error("the suspension page lacks the reason or the way out")
}
st, body := back.do("GET", "/api/v1/org/monitors", nil)
expect(t, "API of a suspended account", st, body, http.StatusForbidden, "account_suspended")
if st, _, _ := back.page("/api/v1/me/export"); st != http.StatusOK {
t.Errorf("export of a suspended account = %d", st)
}
if st, body := back.do("POST", "/api/v1/me/delete", map[string]any{"password": password}); st != http.StatusOK {
t.Fatalf("suspended account deletes itself = %d %v", st, body)
}
for q, arg := range map[string]any{`SELECT count(*) FROM users WHERE id = $1`: userID, `SELECT count(*) FROM orgs WHERE id = $1`: org, `SELECT count(*) FROM monitors WHERE org_id = $1`: org} {
if n := e.count(t, q, arg); n != 0 {
t.Errorf("%s = %d after deletion", q, n)
}
}
}
+29 -25
View File
@@ -31,9 +31,17 @@ type accountExport struct {
Organizations []exportMembership `json:"organizations"` Organizations []exportMembership `json:"organizations"`
Identities []exportIdentity `json:"sso_identities"` Identities []exportIdentity `json:"sso_identities"`
Tokens []exportToken `json:"api_tokens"` Tokens []exportToken `json:"api_tokens"`
Consents []exportConsent `json:"consents"`
Activity []exportActivity `json:"activity"` Activity []exportActivity `json:"activity"`
} }
// exportConsent is an accepted version of the privacy policy or terms.
type exportConsent struct {
Kind string `json:"kind"`
Version int64 `json:"version"`
AcceptedAt time.Time `json:"accepted_at"`
}
type exportAccount struct { type exportAccount struct {
ID uuid.UUID `json:"id"` ID uuid.UUID `json:"id"`
Email string `json:"email"` Email string `json:"email"`
@@ -133,6 +141,14 @@ func (s *Server) buildAccountExport(ctx context.Context, userID uuid.UUID) (acco
if err != nil { if err != nil {
return err return err
} }
consents, err := q.LegalAcceptances(ctx, u.ID)
if err != nil {
return err
}
x.Consents = []exportConsent{}
for _, r := range consents {
x.Consents = append(x.Consents, exportConsent{Kind: r.Kind, Version: r.Version, AcceptedAt: r.AcceptedAt})
}
x.Tokens = []exportToken{} x.Tokens = []exportToken{}
for _, t := range toks { for _, t := range toks {
x.Tokens = append(x.Tokens, exportToken{ x.Tokens = append(x.Tokens, exportToken{
@@ -586,9 +602,12 @@ func purgeOrg(ctx context.Context, q *store.Queries, org uuid.UUID) error {
return err return err
} }
// deleteAccount erases the signed-in user (Art. 17). Organizations only the // deleteAccount erases the signed-in user (Art. 17). Organizations the
// user belongs to go with the account; an organization shared with others // user owns go with the account, monitors and all, even when they have
// must be handed over or deleted first, so nobody loses access to it. // other members: an organization has exactly one owner, and nobody would be
// left to run it.
// Suspended accounts and those that have not accepted the terms may do
// this too.
func (s *Server) deleteAccount(c *gin.Context) { func (s *Server) deleteAccount(c *gin.Context) {
var req deletionRequest var req deletionRequest
if !bind(c, &req) { if !bind(c, &req) {
@@ -609,17 +628,11 @@ func (s *Server) deleteAccount(c *gin.Context) {
fail(c, http.StatusForbidden, "confirmation_failed") fail(c, http.StatusForbidden, "confirmation_failed")
return return
} }
shared, orgsDeleted, err := s.eraseAccount(ctx, u) orgsDeleted, err := s.eraseAccount(ctx, u)
if err != nil { if err != nil {
internalError(c, err) internalError(c, err)
return return
} }
if len(shared) > 0 {
c.JSON(http.StatusConflict, gin.H{
"error": "owns_shared_orgs", "message": i18n.T(ctx, "error.owns_shared_orgs"), "organizations": shared,
})
return
}
auth.ClearCookie(c) auth.ClearCookie(c)
// Kept as proof of erasure, without saying whose. // Kept as proof of erasure, without saying whose.
s.writeAudit(c, store.InsertAuditEventParams{Kind: "platform", Action: "account.delete", Status: http.StatusOK}, s.writeAudit(c, store.InsertAuditEventParams{Kind: "platform", Action: "account.delete", Status: http.StatusOK},
@@ -627,23 +640,14 @@ func (s *Server) deleteAccount(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"status": "deleted"}) c.JSON(http.StatusOK, gin.H{"status": "deleted"})
} }
// eraseAccount deletes u with the organizations only u belongs to and // eraseAccount deletes u with the organizations u owns and ends u's
// ends u's sessions. If u owns organizations shared with others, nothing // sessions; u leaves the others.
// is deleted and their slugs are returned. func (s *Server) eraseAccount(ctx context.Context, u store.User) (orgsDeleted int, err error) {
func (s *Server) eraseAccount(ctx context.Context, u store.User) (shared []string, orgsDeleted int, err error) {
err = s.db.Tx(ctx, tenant.System(), func(q *store.Queries) error { err = s.db.Tx(ctx, tenant.System(), func(q *store.Queries) error {
owned, err := q.OwnedOrgs(ctx, u.ID) owned, err := q.OwnedOrgs(ctx, u.ID)
if err != nil { if err != nil {
return err return err
} }
for _, o := range owned {
if o.Members > 1 {
shared = append(shared, o.Slug)
}
}
if len(shared) > 0 {
return nil
}
for _, o := range owned { for _, o := range owned {
if err := purgeOrg(ctx, q, o.ID); err != nil { if err := purgeOrg(ctx, q, o.ID); err != nil {
return err return err
@@ -663,13 +667,13 @@ func (s *Server) eraseAccount(ctx context.Context, u store.User) (shared []strin
} }
return nil return nil
}) })
if err != nil || len(shared) > 0 { if err != nil {
return shared, 0, err return 0, err
} }
if err := s.sessions.DeleteAllForUser(ctx, u.ID); err != nil { if err := s.sessions.DeleteAllForUser(ctx, u.ID); err != nil {
s.log.ErrorContext(ctx, "ending sessions of deleted account failed", "error", err) s.log.ErrorContext(ctx, "ending sessions of deleted account failed", "error", err)
} }
return nil, orgsDeleted, nil return orgsDeleted, nil
} }
type orgDeletionRequest struct { type orgDeletionRequest struct {
+20 -4
View File
@@ -228,10 +228,6 @@ func TestDeleteAccount(t *testing.T) {
memberID := member.userIDSelf() memberID := member.userIDSelf()
member.do("POST", "/api/v1/org/groups", map[string]any{"name": "By member"}) member.do("POST", "/api/v1/org/groups", map[string]any{"name": "By member"})
// An owner of a shared organization must hand it over first.
if st, body := owner.do("POST", "/api/v1/me/delete", map[string]any{"password": password}); st != http.StatusConflict || body["error"] != "owns_shared_orgs" {
t.Errorf("owner of shared org deletes account = %d %v, want 409", st, body)
}
if st, _ := member.do("POST", "/api/v1/me/delete", map[string]any{"password": "wrong password"}); st != http.StatusForbidden { if st, _ := member.do("POST", "/api/v1/me/delete", map[string]any{"password": "wrong password"}); st != http.StatusForbidden {
t.Errorf("wrong password = %d, want 403", st) t.Errorf("wrong password = %d, want 403", st)
} }
@@ -273,4 +269,24 @@ func TestDeleteAccount(t *testing.T) {
if e.count(t, `SELECT count(*) FROM orgs WHERE id = $1`, soloOrg) != 0 { if e.count(t, `SELECT count(*) FROM orgs WHERE id = $1`, soloOrg) != 0 {
t.Error("sole owner's organization survived") t.Error("sole owner's organization survived")
} }
// The owner takes the organization along, monitors and all, even when
// others still belong to it; the security page says so first.
org := uuid.MustParse(owner.orgID())
owner.do("POST", "/api/v1/org/monitors", map[string]any{"name": "web", "type": "heartbeat", "interval_seconds": 3600})
other := e.joinVia(t, owner.invite("x@"+uniq("da")+".test", owner.roleID("viewer")))
if _, _, html := owner.page("/settings/security"); !strings.Contains(html, "You own these organizations") {
t.Error("the security page does not warn that the organization goes with the account")
}
if st, body := owner.do("POST", "/api/v1/me/delete", map[string]any{"password": password}); st != http.StatusOK {
t.Fatalf("last owner deletes account = %d %v", st, body)
}
for _, q := range []string{`SELECT count(*) FROM orgs WHERE id = $1`, `SELECT count(*) FROM monitors WHERE org_id = $1`} {
if n := e.count(t, q, org); n != 0 {
t.Errorf("%s = %d after the last owner left", q, n)
}
}
if st, me := other.do("GET", "/api/v1/me", nil); st != http.StatusOK || len(me["orgs"].([]any)) != 0 {
t.Errorf("remaining member = %d %v, want an account without the organization", st, me)
}
} }
+15
View File
@@ -246,6 +246,8 @@ func (s *Server) acceptInvitation(c *gin.Context) {
type inviteSignupRequest struct { type inviteSignupRequest struct {
DisplayName string `json:"display_name" binding:"max=200"` DisplayName string `json:"display_name" binding:"max=200"`
Password string `json:"password" binding:"required,max=1024"` Password string `json:"password" binding:"required,max=1024"`
Consent bool `json:"consent"`
ConsentVersions string `json:"consent_versions" binding:"max=200"`
} }
// inviteSignup creates an account for an invited address. It bypasses // inviteSignup creates an account for an invited address. It bypasses
@@ -268,6 +270,10 @@ func (s *Server) inviteSignup(c *gin.Context) {
fail(c, http.StatusGone, "invitation_invalid") fail(c, http.StatusGone, "invitation_invalid")
return return
} }
consent, ok := s.signupConsent(c, req.Consent, req.ConsentVersions)
if !ok {
return
}
hash, err := auth.HashPassword(req.Password) hash, err := auth.HashPassword(req.Password)
if errors.Is(err, auth.ErrPasswordTooShort) { if errors.Is(err, auth.ErrPasswordTooShort) {
fail(c, http.StatusUnprocessableEntity, "password_too_short", "Min", auth.MinPasswordLength) fail(c, http.StatusUnprocessableEntity, "password_too_short", "Min", auth.MinPasswordLength)
@@ -288,6 +294,11 @@ func (s *Server) inviteSignup(c *gin.Context) {
}) })
return err return err
}) })
if err == nil {
err = s.db.Tx(ctx, tenant.User(user.ID), func(q *store.Queries) error {
return recordConsent(ctx, q, user.ID, consent)
})
}
if isUniqueViolation(err, "users_email_key") || isUniqueViolation(err, "users_email_key_idx") { if isUniqueViolation(err, "users_email_key") || isUniqueViolation(err, "users_email_key_idx") {
fail(c, http.StatusConflict, "email_taken") fail(c, http.StatusConflict, "email_taken")
return return
@@ -341,5 +352,9 @@ func (s *Server) invitePage(c *gin.Context) {
} }
} }
} }
if view.Consent, err = s.signupConsentView(ctx); err != nil {
internalError(c, err)
return
}
web.Render(c, http.StatusOK, web.InvitationPage(s.pageFor(c, "invite.title"), view)) web.Render(c, http.StatusOK, web.InvitationPage(s.pageFor(c, "invite.title"), view))
} }
+34 -11
View File
@@ -51,11 +51,20 @@ func (s *Server) platformLegalDocs(ctx context.Context) []agentapi.LegalDoc {
return docs return docs
} }
func validLegalKind(kind string) bool { return slices.Contains(web.LegalKinds, kind) } // legalKinds are the documents org (nil: the platform) can set.
func legalKinds(org *uuid.UUID) []string {
if org == nil {
return web.LegalKinds
}
return web.OrgLegalKinds
}
type legalRequest struct { type legalRequest struct {
URL string `json:"url" binding:"max=2000"` URL string `json:"url" binding:"max=2000"`
Markdown string `json:"markdown" binding:"max=100000"` Markdown string `json:"markdown" binding:"max=100000"`
// NewVersion asks every account to accept the platform's privacy
// policy or terms again.
NewVersion bool `json:"new_version"`
} }
// validLegalURL accepts absolute http and https URLs only, so a stored link // validLegalURL accepts absolute http and https URLs only, so a stored link
@@ -69,7 +78,7 @@ func validLegalURL(raw string) bool {
// nil for the platform. // nil for the platform.
func (s *Server) saveLegal(c *gin.Context, scope tenant.Scope, org *uuid.UUID) bool { func (s *Server) saveLegal(c *gin.Context, scope tenant.Scope, org *uuid.UUID) bool {
kind := c.Param("kind") kind := c.Param("kind")
if !validLegalKind(kind) { if !slices.Contains(legalKinds(org), kind) {
fail(c, http.StatusNotFound, "not_found") fail(c, http.StatusNotFound, "not_found")
return false return false
} }
@@ -83,12 +92,16 @@ func (s *Server) saveLegal(c *gin.Context, scope tenant.Scope, org *uuid.UUID) b
return false return false
} }
auditDetail(c, "kind", kind) auditDetail(c, "kind", kind)
newVersion := req.NewVersion && org == nil && slices.Contains(web.ConsentKinds, kind)
if newVersion {
auditDetail(c, "new_version", "true")
}
ctx := c.Request.Context() ctx := c.Request.Context()
err := s.db.Tx(ctx, scope, func(q *store.Queries) error { err := s.db.Tx(ctx, scope, func(q *store.Queries) error {
if req.URL == "" && req.Markdown == "" { if req.URL == "" && req.Markdown == "" {
return q.DeleteLegalDocument(ctx, store.DeleteLegalDocumentParams{OrgID: org, Kind: kind}) return q.DeleteLegalDocument(ctx, store.DeleteLegalDocumentParams{OrgID: org, Kind: kind})
} }
return q.UpsertLegalDocument(ctx, store.UpsertLegalDocumentParams{OrgID: org, Kind: kind, Url: req.URL, Markdown: req.Markdown}) return q.UpsertLegalDocument(ctx, store.UpsertLegalDocumentParams{OrgID: org, Kind: kind, Url: req.URL, Markdown: req.Markdown, NewVersion: newVersion})
}) })
if err != nil { if err != nil {
internalError(c, err) internalError(c, err)
@@ -100,8 +113,11 @@ func (s *Server) saveLegal(c *gin.Context, scope tenant.Scope, org *uuid.UUID) b
func (s *Server) adminSaveLegal(c *gin.Context) { func (s *Server) adminSaveLegal(c *gin.Context) {
if s.saveLegal(c, tenant.System(), nil) { if s.saveLegal(c, tenant.System(), nil) {
if err := s.legal.bump(c.Request.Context(), s.rdb); err != nil { ctx := c.Request.Context()
s.log.ErrorContext(c.Request.Context(), "announcing legal document change failed", "error", err) for _, err := range []error{s.legal.bump(ctx, s.rdb), s.consent.bump(ctx, s.rdb)} {
if err != nil {
s.log.ErrorContext(ctx, "announcing legal document change failed", "error", err)
}
} }
} }
} }
@@ -115,6 +131,8 @@ type legalView struct {
Kind string `json:"kind"` Kind string `json:"kind"`
URL string `json:"url"` URL string `json:"url"`
Markdown string `json:"markdown"` Markdown string `json:"markdown"`
// Version changes whenever accounts have to accept the document again.
Version int64 `json:"version,omitempty"`
} }
// ownLegal returns the documents stored for org (nil: the platform), // ownLegal returns the documents stored for org (nil: the platform),
@@ -126,12 +144,15 @@ func (s *Server) ownLegal(ctx context.Context, scope tenant.Scope, org *uuid.UUI
rows, err = q.LegalDocuments(ctx, org) rows, err = q.LegalDocuments(ctx, org)
return err return err
}) })
out := make([]legalView, 0, len(web.LegalKinds)) out := make([]legalView, 0, len(legalKinds(org)))
for _, kind := range web.LegalKinds { for _, kind := range legalKinds(org) {
v := legalView{Kind: kind} v := legalView{Kind: kind}
for _, r := range rows { for _, r := range rows {
if r.Kind == kind && (r.OrgID == nil) == (org == nil) { if r.Kind == kind && (r.OrgID == nil) == (org == nil) {
v.URL, v.Markdown = r.Url, r.Markdown v.URL, v.Markdown = r.Url, r.Markdown
if org == nil && slices.Contains(web.ConsentKinds, kind) {
v.Version = r.Version
}
} }
} }
out = append(out, v) out = append(out, v)
@@ -190,10 +211,12 @@ func (s *Server) legalPage(c *gin.Context) {
c.Status(http.StatusNotFound) c.Status(http.StatusNotFound)
} }
func toLegalForms(docs []legalView) []web.LegalForm { // toLegalForms prepares the forms; the platform's privacy policy and terms
// can ask everyone to accept them again.
func toLegalForms(docs []legalView, platform bool) []web.LegalForm {
out := make([]web.LegalForm, len(docs)) out := make([]web.LegalForm, len(docs))
for i, d := range docs { for i, d := range docs {
out[i] = web.LegalForm{Kind: d.Kind, URL: d.URL, Markdown: d.Markdown} out[i] = web.LegalForm{Kind: d.Kind, URL: d.URL, Markdown: d.Markdown, Consent: platform && slices.Contains(web.ConsentKinds, d.Kind)}
} }
return out return out
} }
@@ -203,7 +226,7 @@ func (s *Server) orgLegalView(c *gin.Context, p *principal, page web.Page, me we
if err != nil { if err != nil {
return nil, err return nil, err
} }
return web.LegalSettingsPage(page, me, "legal.org_title", "legal.org_intro", "/org/legal/", "/settings/legal", toLegalForms(docs)), nil return web.LegalSettingsPage(page, me, "legal.org_title", "legal.org_intro", "/org/legal/", "/settings/legal", toLegalForms(docs, false)), nil
} }
func (s *Server) adminLegalPage(c *gin.Context) { func (s *Server) adminLegalPage(c *gin.Context) {
@@ -216,5 +239,5 @@ func (s *Server) adminLegalPage(c *gin.Context) {
internalError(c, err) internalError(c, err)
return return
} }
web.Render(c, http.StatusOK, web.LegalSettingsPage(s.pageFor(c, "legal.platform_title"), me, "legal.platform_title", "legal.platform_intro", "/admin/legal/", "/admin/legal", toLegalForms(docs))) web.Render(c, http.StatusOK, web.LegalSettingsPage(s.pageFor(c, "legal.platform_title"), me, "legal.platform_title", "legal.platform_intro", "/admin/legal/", "/admin/legal", toLegalForms(docs, true)))
} }
+15 -7
View File
@@ -21,11 +21,7 @@ func TestLegalDocuments(t *testing.T) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
t.Cleanup(func() { t.Cleanup(func() { clearPlatformLegal(admin) })
for _, kind := range []string{"imprint", "privacy"} {
admin.do("PUT", "/api/v1/admin/legal/"+kind, map[string]any{})
}
})
imprint := "# Impressum\n\nBetreiber GmbH <script>alert(1)</script>" imprint := "# Impressum\n\nBetreiber GmbH <script>alert(1)</script>"
st, body := admin.do("PUT", "/api/v1/admin/legal/imprint", map[string]any{"markdown": imprint}) st, body := admin.do("PUT", "/api/v1/admin/legal/imprint", map[string]any{"markdown": imprint})
@@ -34,7 +30,8 @@ func TestLegalDocuments(t *testing.T) {
expect(t, "javascript link", st, body, http.StatusUnprocessableEntity, "invalid_legal_url") expect(t, "javascript link", st, body, http.StatusUnprocessableEntity, "invalid_legal_url")
st, body = admin.do("PUT", "/api/v1/admin/legal/privacy", map[string]any{"url": "https://operator.example/privacy"}) st, body = admin.do("PUT", "/api/v1/admin/legal/privacy", map[string]any{"url": "https://operator.example/privacy"})
expect(t, "admin sets privacy link", st, body, http.StatusNoContent, "") expect(t, "admin sets privacy link", st, body, http.StatusNoContent, "")
st, body = admin.do("PUT", "/api/v1/admin/legal/terms", map[string]any{"markdown": "x"}) admin.acceptConsent()
st, body = admin.do("PUT", "/api/v1/admin/legal/cookies", map[string]any{"markdown": "x"})
expect(t, "unknown kind", st, body, http.StatusNotFound, "not_found") expect(t, "unknown kind", st, body, http.StatusNotFound, "not_found")
// The console footer links them, also before signing in. // The console footer links them, also before signing in.
@@ -121,7 +118,7 @@ func TestLegalChangeReachesOtherReplicas(t *testing.T) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
t.Cleanup(func() { admin.do("PUT", "/api/v1/admin/legal/imprint", map[string]any{}) }) t.Cleanup(func() { clearPlatformLegal(admin) })
admin.do("PUT", "/api/v1/admin/legal/imprint", map[string]any{}) admin.do("PUT", "/api/v1/admin/legal/imprint", map[string]any{})
visitor := b.browser(t) visitor := b.browser(t)
@@ -147,3 +144,14 @@ func TestMarkdownPreview(t *testing.T) {
t.Errorf("preview = %d %q", st, html) t.Errorf("preview = %d %q", st, html)
} }
} }
// clearPlatformLegal removes the platform's documents again, so other tests
// sign up without consent.
func clearPlatformLegal(admin *browser) {
admin.acceptConsent()
for _, kind := range []string{"imprint", "privacy", "terms"} {
if st, body := admin.do("PUT", "/api/v1/admin/legal/"+kind, map[string]any{}); st != http.StatusNoContent {
admin.t.Errorf("clearing platform %s = %d %v", kind, st, body)
}
}
}
+1 -8
View File
@@ -11,7 +11,6 @@ import (
"github.com/google/uuid" "github.com/google/uuid"
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"git.zb-server.de/ZB-Server/uptimesebi/internal/i18n"
"git.zb-server.de/ZB-Server/uptimesebi/internal/store" "git.zb-server.de/ZB-Server/uptimesebi/internal/store"
"git.zb-server.de/ZB-Server/uptimesebi/internal/tenant" "git.zb-server.de/ZB-Server/uptimesebi/internal/tenant"
"git.zb-server.de/ZB-Server/uptimesebi/internal/web" "git.zb-server.de/ZB-Server/uptimesebi/internal/web"
@@ -262,17 +261,11 @@ func (s *Server) adminDeleteUser(c *gin.Context) {
return return
} }
ctx := c.Request.Context() ctx := c.Request.Context()
shared, orgsDeleted, err := s.eraseAccount(ctx, u) orgsDeleted, err := s.eraseAccount(ctx, u)
if err != nil { if err != nil {
internalError(c, err) internalError(c, err)
return return
} }
if len(shared) > 0 {
c.JSON(http.StatusConflict, gin.H{
"error": "owns_shared_orgs", "message": i18n.T(ctx, "error.user_owns_shared_orgs"), "organizations": shared,
})
return
}
auditDetail(c, "organizations_deleted", orgsDeleted) auditDetail(c, "organizations_deleted", orgsDeleted)
c.Status(http.StatusNoContent) c.Status(http.StatusNoContent)
} }
+7 -9
View File
@@ -140,7 +140,8 @@ func TestModeration(t *testing.T) {
t.Error("a heartbeat after reinstatement is not recorded") t.Error("a heartbeat after reinstatement is not recorded")
} }
// A suspended account is signed out and kept out, tokens included. // A suspended account is signed out, its tokens stop working, and
// signing in again only lets it export or delete its data.
suspend("users/"+userID, true, "") suspend("users/"+userID, true, "")
if st, _ := owner.do("GET", "/api/v1/me", nil); st != http.StatusUnauthorized { if st, _ := owner.do("GET", "/api/v1/me", nil); st != http.StatusUnauthorized {
t.Errorf("session of a suspended account = %d", st) t.Errorf("session of a suspended account = %d", st)
@@ -149,8 +150,11 @@ func TestModeration(t *testing.T) {
t.Errorf("token of a suspended account = %d", st) t.Errorf("token of a suspended account = %d", st)
} }
fresh := e.browser(t) fresh := e.browser(t)
st, body = fresh.do("POST", "/api/v1/auth/login", map[string]any{"email": ownerEmail, "password": testPassword}) if st, body := fresh.do("POST", "/api/v1/auth/login", map[string]any{"email": ownerEmail, "password": testPassword}); st != http.StatusOK {
expect(t, "sign-in of a suspended account", st, body, http.StatusForbidden, "account_suspended") t.Errorf("sign-in of a suspended account = %d %v", st, body)
}
st, body = fresh.do("GET", "/api/v1/org/monitors", nil)
expect(t, "API of a suspended account", st, body, http.StatusForbidden, "account_suspended")
if st, _ := e.browser(t).do("POST", "/api/v1/auth/login", map[string]any{"email": ownerEmail, "password": "wrong password"}); st != http.StatusUnauthorized { if st, _ := e.browser(t).do("POST", "/api/v1/auth/login", map[string]any{"email": ownerEmail, "password": "wrong password"}); st != http.StatusUnauthorized {
t.Error("a wrong password reveals the suspension") t.Error("a wrong password reveals the suspension")
} }
@@ -165,12 +169,6 @@ func TestModeration(t *testing.T) {
st, body = admin.do("DELETE", "/api/v1/admin/users/"+admin.userIDSelf().String(), nil) st, body = admin.do("DELETE", "/api/v1/admin/users/"+admin.userIDSelf().String(), nil)
expect(t, "delete an admin", st, body, http.StatusConflict, "target_is_admin") expect(t, "delete an admin", st, body, http.StatusConflict, "target_is_admin")
// An owner of a shared organization cannot be deleted before it.
fresh.do("POST", "/api/v1/me/org", map[string]any{"org_id": orgID})
e.joinVia(t, fresh.invite("m@"+uniq("mod")+".test", fresh.roleID("viewer")))
st, body = admin.do("DELETE", "/api/v1/admin/users/"+userID, nil)
expect(t, "delete the owner of a shared org", st, body, http.StatusConflict, "owns_shared_orgs")
// Deleting: page, organization, account. // Deleting: page, organization, account.
if st, _ := admin.do("DELETE", "/api/v1/admin/status-pages/"+page["id"].(string), nil); st != http.StatusNoContent || served() { if st, _ := admin.do("DELETE", "/api/v1/admin/status-pages/"+page["id"].(string), nil); st != http.StatusNoContent || served() {
t.Errorf("delete page = %d", st) t.Errorf("delete page = %d", st)
+12 -1
View File
@@ -48,6 +48,8 @@ func (s *Server) registerPages(r gin.IRouter) {
r.GET("/admin/legal", s.adminLegalPage) r.GET("/admin/legal", s.adminLegalPage)
r.GET("/settings/legal", s.orgPage("legal.org_title", authz.OrgManage, s.orgLegalView)) r.GET("/settings/legal", s.orgPage("legal.org_title", authz.OrgManage, s.orgLegalView))
r.GET("/legal/:kind", s.legalPage) r.GET("/legal/:kind", s.legalPage)
r.GET("/consent", s.consentPage)
r.GET("/account/suspended", s.suspendedPage)
} }
// flashErrors lists the codes a redirect may ask a page to display. Anything // flashErrors lists the codes a redirect may ask a page to display. Anything
@@ -123,7 +125,12 @@ func (s *Server) signupPage(c *gin.Context) {
c.Redirect(http.StatusSeeOther, "/login") c.Redirect(http.StatusSeeOther, "/login")
return return
} }
web.Render(c, http.StatusOK, web.Signup(s.pageFor(c, "auth.signup.title"), providers, email)) consent, err := s.signupConsentView(c.Request.Context())
if err != nil {
internalError(c, err)
return
}
web.Render(c, http.StatusOK, web.Signup(s.pageFor(c, "auth.signup.title"), providers, email, consent))
} }
func (s *Server) signupSentPage(c *gin.Context) { func (s *Server) signupSentPage(c *gin.Context) {
@@ -249,6 +256,10 @@ func (s *Server) securityPage(c *gin.Context) {
internalError(c, err) internalError(c, err)
return return
} }
if me.DeletesOrgs, err = s.ownedOrgs(ctx, sess.UserID); err != nil {
internalError(c, err)
return
}
var ( var (
identities []web.Identity identities []web.Identity
canLink bool canLink bool
+5 -1
View File
@@ -26,7 +26,11 @@ func (b *browser) invite(email, roleID string) string {
func (e *env) joinVia(t *testing.T, tok string) *browser { func (e *env) joinVia(t *testing.T, tok string) *browser {
t.Helper() t.Helper()
b := e.browser(t) b := e.browser(t)
st, body := b.do("POST", "/api/v1/invitations/"+tok+"/signup", map[string]any{"password": password}) _, _, form := b.page("/invite/" + tok)
versions := consentShown(form)
st, body := b.do("POST", "/api/v1/invitations/"+tok+"/signup", map[string]any{
"password": password, "consent": versions != "", "consent_versions": versions,
})
if st != http.StatusOK { if st != http.StatusOK {
t.Fatalf("invite signup = %d %v, want 200", st, body) t.Fatalf("invite signup = %d %v, want 200", st, body)
} }
+2 -4
View File
@@ -168,10 +168,8 @@ func (s *Server) platformCallback(c *gin.Context, f ssoFlow, state string) {
internalError(c, err) internalError(c, err)
return return
} }
if user.DisabledAt != nil { // Suspended accounts sign in too, but only to export or delete their
s.ssoAbort(c, uuid.Nil, "account_suspended") // data (accountGate).
return
}
// The account's second factor still applies; the provider replaces // The account's second factor still applies; the provider replaces
// only the password. // only the password.
if user.TotpSecret != nil { if user.TotpSecret != nil {
+5 -1
View File
@@ -44,6 +44,8 @@ type Server struct {
eval *evaluate.Evaluator eval *evaluate.Evaluator
smtp *notify.SMTP smtp *notify.SMTP
legal *versioned[[]agentapi.LegalDoc] legal *versioned[[]agentapi.LegalDoc]
// consent caches the versions of the documents accounts accept.
consent *versioned[map[string]int64]
// checkTypes caches the check types switched off platform-wide. // checkTypes caches the check types switched off platform-wide.
checkTypes *versioned[map[string]bool] checkTypes *versioned[map[string]bool]
// checkerNet caches whether platform checkers may reach private // checkerNet caches whether platform checkers may reach private
@@ -82,6 +84,7 @@ func New(cfg config.API, d Deps) *Server {
sso: sso.New(sso.SafeHTTPClient(allowPrivate), cfg.PublicURL+"/sso/callback", allowPrivate), sso: sso.New(sso.SafeHTTPClient(allowPrivate), cfg.PublicURL+"/sso/callback", allowPrivate),
sched: schedule.New(d.Redis), sched: schedule.New(d.Redis),
legal: newVersioned[[]agentapi.LegalDoc]("legal"), legal: newVersioned[[]agentapi.LegalDoc]("legal"),
consent: newVersioned[map[string]int64]("consent"),
checkTypes: newVersioned[map[string]bool]("check-types"), checkTypes: newVersioned[map[string]bool]("check-types"),
checkerNet: newVersioned[bool]("checker-network"), checkerNet: newVersioned[bool]("checker-network"),
limits: newVersioned[Limits]("limits"), limits: newVersioned[Limits]("limits"),
@@ -97,7 +100,7 @@ func (s *Server) Mount(r gin.IRouter) {
s.mountHeartbeats(r) s.mountHeartbeats(r)
s.mountAlertmanager(r) s.mountAlertmanager(r)
g := r.Group("/", s.sessions.Load(), s.localize(), auth.CSRF(), s.audit()) g := r.Group("/", s.sessions.Load(), s.localize(), auth.CSRF(), s.audit(), s.accountGate())
r.GET("/api/openapi.json", s.openAPIJSON) r.GET("/api/openapi.json", s.openAPIJSON)
r.GET("/install.sh", s.installScript) r.GET("/install.sh", s.installScript)
@@ -115,6 +118,7 @@ func (s *Server) Mount(r gin.IRouter) {
a.POST("/login", s.login) a.POST("/login", s.login)
a.POST("/login/totp", s.loginTOTP) a.POST("/login/totp", s.loginTOTP)
a.POST("/logout", s.logout) a.POST("/logout", s.logout)
v1.POST("/consent", auth.Require(), s.acceptConsent)
me := v1.Group("/me", auth.Require()) me := v1.Group("/me", auth.Require())
me.GET("", s.me) me.GET("", s.me)
+2 -4
View File
@@ -261,10 +261,8 @@ func (s *Server) ssoCallback(c *gin.Context) {
internalError(c, err) internalError(c, err)
return return
} }
if user.DisabledAt != nil { // Suspended accounts sign in too, but only to export or delete their
s.ssoAbort(c, uuid.Nil, "account_suspended") // data (accountGate).
return
}
if old := auth.Current(c); old != nil { if old := auth.Current(c); old != nil {
_ = s.sessions.Delete(ctx, old) _ = s.sessions.Delete(ctx, old)
} }
+28
View File
@@ -13,6 +13,7 @@ import (
"net/http/httptest" "net/http/httptest"
"net/url" "net/url"
"os" "os"
"regexp"
"strings" "strings"
"testing" "testing"
"time" "time"
@@ -170,10 +171,37 @@ func (b *browser) visit(path string) *url.URL {
func uniq(prefix string) string { return prefix + strings.ReplaceAll(uuid.NewString()[:8], "-", "") } func uniq(prefix string) string { return prefix + strings.ReplaceAll(uuid.NewString()[:8], "-", "") }
var consentVersionsField = regexp.MustCompile(`name="(?:consent_versions|versions)" value="([^"]*)"`)
// consentShown returns the document versions a page asks to accept, empty
// when it asks for none.
func consentShown(html string) string {
if m := consentVersionsField.FindStringSubmatch(html); m != nil {
return m[1]
}
return ""
}
// acceptConsent accepts the documents the console asks for, as someone
// ticking the box on /consent would.
func (b *browser) acceptConsent() {
b.t.Helper()
_, _, html := b.page("/consent")
if v := consentShown(html); v != "" {
if st, body := b.do("POST", "/api/v1/consent", map[string]any{"versions": v, "accept": true}); st != http.StatusOK {
b.t.Fatalf("accept consent = %d %v", st, body)
}
}
}
func (b *browser) signup(email, slug string) { func (b *browser) signup(email, slug string) {
b.t.Helper() b.t.Helper()
// Tick the consent box the sign-up page shows, if any.
_, _, form := b.page("/signup")
versions := consentShown(form)
st, body := b.do("POST", "/api/v1/auth/signup", map[string]any{ st, body := b.do("POST", "/api/v1/auth/signup", map[string]any{
"email": email, "password": "correct horse battery", "org_name": slug, "org_slug": slug, "email": email, "password": "correct horse battery", "org_name": slug, "org_slug": slug,
"consent": versions != "", "consent_versions": versions,
}) })
if st != http.StatusOK { if st != http.StatusOK {
b.t.Fatalf("signup(%s) = %d %v, want 200", email, st, body) b.t.Fatalf("signup(%s) = %d %v, want 200", email, st, body)
+2 -1
View File
@@ -105,7 +105,8 @@ func (s *Server) buildSnapshot(ctx context.Context, page store.StatusPage) (agen
return err return err
} }
docs, err := q.LegalDocuments(ctx, &page.OrgID) docs, err := q.LegalDocuments(ctx, &page.OrgID)
snap.Legal = mergeLegal(docs) // Visitors of status pages accept no terms.
snap.Legal = slices.DeleteFunc(mergeLegal(docs), func(d agentapi.LegalDoc) bool { return d.Kind == "terms" })
return err return err
}) })
if err != nil { if err != nil {
+26 -5
View File
@@ -60,6 +60,7 @@
"apidocs.hint": "„Try it out“ nutzt deine aktuelle Sitzung.", "apidocs.hint": "„Try it out“ nutzt deine aktuelle Sitzung.",
"apidocs.title": "API-Dokumentation", "apidocs.title": "API-Dokumentation",
"app.network_error": "Verbindung fehlgeschlagen.", "app.network_error": "Verbindung fehlgeschlagen.",
"audit.action.account.consent": "Datenschutz und AGB zugestimmt",
"audit.action.account.delete": "Konto gelöscht", "audit.action.account.delete": "Konto gelöscht",
"audit.action.account.export": "Persönliche Daten exportiert", "audit.action.account.export": "Persönliche Daten exportiert",
"audit.action.account.identity_link": "Anmelde-Anbieter verbunden", "audit.action.account.identity_link": "Anmelde-Anbieter verbunden",
@@ -474,6 +475,16 @@
"common.no": "nein", "common.no": "nein",
"common.save": "Speichern", "common.save": "Speichern",
"common.yes": "ja", "common.yes": "ja",
"consent.accept_prefix": "Ich habe die",
"consent.accept_suffix": "gelesen und stimme zu.",
"consent.and": "und die",
"consent.decline": "Wenn du nicht zustimmst, kannst du deine Daten mitnehmen und dein Konto löschen.",
"consent.doc.privacy": "Datenschutzerklärung",
"consent.doc.terms": "AGB",
"consent.intro": "Um weiterzumachen, lies bitte diese Dokumente und stimme ihnen zu. Sie sind neu oder haben sich seit deiner letzten Zustimmung geändert.",
"consent.sso_hint": "Bei der Registrierung über einen Anbieter fragen wir direkt nach der ersten Anmeldung nach deiner Zustimmung.",
"consent.submit": "Zustimmen und weiter",
"consent.title": "Bitte stimme unseren Bedingungen zu",
"console.monitors.empty": "Noch keine Monitore angelegt.", "console.monitors.empty": "Noch keine Monitore angelegt.",
"console.monitors.title": "Monitore", "console.monitors.title": "Monitore",
"console.nav.admin": "Admin", "console.nav.admin": "Admin",
@@ -508,6 +519,8 @@
"error.channel_type_immutable": "Der Typ eines Kanals kann nicht geändert werden.", "error.channel_type_immutable": "Der Typ eines Kanals kann nicht geändert werden.",
"error.check_type_disabled": "Dieser Check-Typ ist für diese Organisation oder Installation abgeschaltet.", "error.check_type_disabled": "Dieser Check-Typ ist für diese Organisation oder Installation abgeschaltet.",
"error.confirmation_failed": "Die Bestätigung stimmt nicht.", "error.confirmation_failed": "Die Bestätigung stimmt nicht.",
"error.consent_outdated": "Die Dokumente haben sich inzwischen geändert. Lade die Seite neu und stimme der aktuellen Fassung zu.",
"error.consent_required": "Bitte stimme zuerst Datenschutz und AGB zu.",
"error.domain_not_verified": "Der TXT-Eintrag wurde noch nicht gefunden. DNS-Änderungen brauchen manchmal etwas Zeit.", "error.domain_not_verified": "Der TXT-Eintrag wurde noch nicht gefunden. DNS-Änderungen brauchen manchmal etwas Zeit.",
"error.domain_taken": "Diese Domain nutzt bereits eine andere Statuspage.", "error.domain_taken": "Diese Domain nutzt bereits eine andere Statuspage.",
"error.email_not_configured": "E-Mail ist auf diesem Server nicht verfügbar.", "error.email_not_configured": "E-Mail ist auf diesem Server nicht verfügbar.",
@@ -577,7 +590,6 @@
"error.org_suspended": "Der Betreiber hat diese Organisation gesperrt.", "error.org_suspended": "Der Betreiber hat diese Organisation gesperrt.",
"error.owner_cannot_be_removed": "Der Owner kann nicht entfernt werden.", "error.owner_cannot_be_removed": "Der Owner kann nicht entfernt werden.",
"error.owner_has_all_permissions": "Der Owner hat bereits alle Berechtigungen.", "error.owner_has_all_permissions": "Der Owner hat bereits alle Berechtigungen.",
"error.owns_shared_orgs": "Du besitzt Organisationen mit weiteren Mitgliedern. Übergib oder lösche sie zuerst.",
"error.password_too_short": "Das Passwort braucht mindestens {{.Min}} Zeichen.", "error.password_too_short": "Das Passwort braucht mindestens {{.Min}} Zeichen.",
"error.permission_escalation": "Du kannst keine Berechtigungen vergeben, die du selbst nicht hast.", "error.permission_escalation": "Du kannst keine Berechtigungen vergeben, die du selbst nicht hast.",
"error.platform_region_limit": "Ein Monitor darf aus höchstens {{.Max}} Plattform-Regionen geprüft werden; eigene Checker-Regionen zählen nicht.", "error.platform_region_limit": "Ein Monitor darf aus höchstens {{.Max}} Plattform-Regionen geprüft werden; eigene Checker-Regionen zählen nicht.",
@@ -619,7 +631,6 @@
"error.totp_setup_expired": "Einrichtung abgelaufen, bitte neu starten.", "error.totp_setup_expired": "Einrichtung abgelaufen, bitte neu starten.",
"error.unauthenticated": "Anmeldung erforderlich.", "error.unauthenticated": "Anmeldung erforderlich.",
"error.unsupported_locale": "Sprache wird nicht unterstützt.", "error.unsupported_locale": "Sprache wird nicht unterstützt.",
"error.user_owns_shared_orgs": "Dem Account gehören Organisationen mit weiteren Mitgliedern. Lösche diese zuerst oder übertrage sie.",
"error.verification_expired": "Dieser Bestätigungslink ist ungültig oder abgelaufen. Fordere einen neuen an.", "error.verification_expired": "Dieser Bestätigungslink ist ungültig oder abgelaufen. Fordere einen neuen an.",
"error.verification_mail_failed": "Dein Konto wurde angelegt, aber die Bestätigungs-E-Mail konnte nicht gesendet werden. Fordere später einen neuen Link an.", "error.verification_mail_failed": "Dein Konto wurde angelegt, aber die Bestätigungs-E-Mail konnte nicht gesendet werden. Fordere später einen neuen Link an.",
"evidence.body": "Antwort-Body", "evidence.body": "Antwort-Body",
@@ -662,6 +673,7 @@
"export.account_title": "Export personenbezogener Daten", "export.account_title": "Export personenbezogener Daten",
"export.download_json": "JSON herunterladen", "export.download_json": "JSON herunterladen",
"export.download_pdf": "PDF herunterladen", "export.download_pdf": "PDF herunterladen",
"export.field.accepted_at": "Zugestimmt am",
"export.field.account": "Konto", "export.field.account": "Konto",
"export.field.action": "Aktion", "export.field.action": "Aktion",
"export.field.activity": "Aktivität", "export.field.activity": "Aktivität",
@@ -676,6 +688,7 @@
"export.field.client_id": "Client-ID", "export.field.client_id": "Client-ID",
"export.field.config": "Konfiguration", "export.field.config": "Konfiguration",
"export.field.confirmations": "Bestätigungen", "export.field.confirmations": "Bestätigungen",
"export.field.consents": "Zugestimmte Dokumente",
"export.field.created_at": "Erstellt", "export.field.created_at": "Erstellt",
"export.field.custom_domain": "Eigene Domain", "export.field.custom_domain": "Eigene Domain",
"export.field.custom_roles": "Eigene Rollen", "export.field.custom_roles": "Eigene Rollen",
@@ -745,6 +758,7 @@
"export.field.totp_enabled_at": "Zwei-Faktor aktiviert", "export.field.totp_enabled_at": "Zwei-Faktor aktiviert",
"export.field.type": "Typ", "export.field.type": "Typ",
"export.field.user_agent": "Browser", "export.field.user_agent": "Browser",
"export.field.version": "Version",
"export.json_only": "Nur im JSON-Export enthalten.", "export.json_only": "Nur im JSON-Export enthalten.",
"export.no": "nein", "export.no": "nein",
"export.none": "Keine.", "export.none": "Keine.",
@@ -754,10 +768,11 @@
"gdpr.account_export_intro": "Lade alles herunter, was über dich gespeichert ist: Profil, Mitgliedschaften, Anmeldeidentitäten, API-Tokens und deine Aktivität. JSON ist maschinenlesbar, PDF gut lesbar.", "gdpr.account_export_intro": "Lade alles herunter, was über dich gespeichert ist: Profil, Mitgliedschaften, Anmeldeidentitäten, API-Tokens und deine Aktivität. JSON ist maschinenlesbar, PDF gut lesbar.",
"gdpr.delete_account": "Konto löschen", "gdpr.delete_account": "Konto löschen",
"gdpr.delete_account_confirm": "Konto endgültig löschen? Das lässt sich nicht rückgängig machen.", "gdpr.delete_account_confirm": "Konto endgültig löschen? Das lässt sich nicht rückgängig machen.",
"gdpr.delete_account_intro": "Löscht dein Konto sofort und meldet dich überall ab. Organisationen, denen nur du angehörst, werden mitgelöscht. Organisationen, die du mit anderen teilst und besitzt, musst du vorher übergeben oder löschen. Audit-Einträge in anderen Organisationen bleiben als „Gelöschter Benutzer“ erhalten.", "gdpr.delete_account_intro": "Löscht dein Konto sofort und meldet dich überall ab. Organisationen, die dir gehören, werden mit allem darin mitgelöscht, auch für ihre anderen Mitglieder; aus den übrigen trittst du nur aus. Audit-Einträge in anderen Organisationen bleiben als „Gelöschter Benutzer“ erhalten.",
"gdpr.delete_org": "Organisation löschen", "gdpr.delete_org": "Organisation löschen",
"gdpr.delete_org_confirm": "Diese Organisation und alle ihre Daten endgültig löschen?", "gdpr.delete_org_confirm": "Diese Organisation und alle ihre Daten endgültig löschen?",
"gdpr.delete_org_intro": "Löscht die Organisation mit allen Monitoren, Check-Ergebnissen, Statusseiten, Zugängen der Mitglieder und API-Tokens, sofort und endgültig. Die Konten der Mitglieder bleiben bestehen.", "gdpr.delete_org_intro": "Löscht die Organisation mit allen Monitoren, Check-Ergebnissen, Statusseiten, Zugängen der Mitglieder und API-Tokens, sofort und endgültig. Die Konten der Mitglieder bleiben bestehen.",
"gdpr.deletes_orgs": "Diese Organisationen gehören dir. Sie werden mit deinem Konto gelöscht, mit allen Monitoren und Statusseiten, auch für ihre anderen Mitglieder:",
"gdpr.org_data": "Daten der Organisation", "gdpr.org_data": "Daten der Organisation",
"gdpr.org_export_intro": "Lade Mitglieder, Rollen, Monitore, Gruppen, Kanäle, Statusseiten, SSO-Einstellungen, Vorfälle, das Audit-Log und die Tagesstatistik herunter. Geheimnisse sind nicht enthalten.", "gdpr.org_export_intro": "Lade Mitglieder, Rollen, Monitore, Gruppen, Kanäle, Statusseiten, SSO-Einstellungen, Vorfälle, das Audit-Log und die Tagesstatistik herunter. Geheimnisse sind nicht enthalten.",
"gdpr.password": "Dein Passwort", "gdpr.password": "Dein Passwort",
@@ -803,11 +818,14 @@
"legal.hint": "Ein Link hat Vorrang vor dem Text. Beide Felder leer lassen, um das Dokument zu entfernen.", "legal.hint": "Ein Link hat Vorrang vor dem Text. Beide Felder leer lassen, um das Dokument zu entfernen.",
"legal.imprint": "Impressum", "legal.imprint": "Impressum",
"legal.markdown": "Oder Text (Markdown)", "legal.markdown": "Oder Text (Markdown)",
"legal.new_version": "Alle müssen neu zustimmen",
"legal.new_version_hint": "Für wesentliche Änderungen: Jedes Konto wird bei seiner nächsten Anfrage gebeten, der neuen Fassung zuzustimmen, und kann bis dahin nichts anderes nutzen. Für Korrekturen ausgeschaltet lassen.",
"legal.org_intro": "Werden auf den Statusseiten deiner Organisation angezeigt. Ohne eigene Dokumente werden die der Plattform verwendet.", "legal.org_intro": "Werden auf den Statusseiten deiner Organisation angezeigt. Ohne eigene Dokumente werden die der Plattform verwendet.",
"legal.org_title": "Impressum & Datenschutz", "legal.org_title": "Impressum & Datenschutz",
"legal.platform_intro": "Im Footer der Konsole und der Anmeldeseiten verlinkt sowie auf Statusseiten von Organisationen ohne eigene Dokumente.", "legal.platform_intro": "Im Fuß der Konsole und der Anmeldeseiten verlinkt; Impressum und Datenschutz auch auf Statusseiten von Organisationen ohne eigene. Jedes Konto stimmt Datenschutz und AGB bei der Registrierung zu und erneut, wenn du es verlangst.",
"legal.platform_title": "Impressum & Datenschutz der Plattform", "legal.platform_title": "Impressum, Datenschutz & AGB der Plattform",
"legal.privacy": "Datenschutz", "legal.privacy": "Datenschutz",
"legal.terms": "AGB",
"legal.url": "Link auf eine bestehende Seite", "legal.url": "Link auf eine bestehende Seite",
"limits.default": "Standard: {{.Value}}", "limits.default": "Standard: {{.Value}}",
"limits.intro": "Gelten für jede Organisation und jeden Account ohne eigenen Wert, auch wenn du sie später änderst. 0 heißt unbegrenzt. Ein gesenktes Limit lässt alles Bestehende stehen; nur neue Monitore, Statusseiten, Regionen oder Organisationen werden abgelehnt.", "limits.intro": "Gelten für jede Organisation und jeden Account ohne eigenen Wert, auch wenn du sie später änderst. 0 heißt unbegrenzt. Ein gesenktes Limit lässt alles Bestehende stehen; nur neue Monitore, Statusseiten, Regionen oder Organisationen werden abgelehnt.",
@@ -1309,6 +1327,9 @@
"storage.retention": "Löschen nach", "storage.retention": "Löschen nach",
"storage.size": "Größe", "storage.size": "Größe",
"storage.title": "Datenspeicher", "storage.title": "Datenspeicher",
"suspended.intro": "Die Administratoren der Plattform haben dein Konto gesperrt.",
"suspended.options": "Du kannst deine Daten weiterhin herunterladen oder dein Konto löschen.",
"suspended.title": "Konto gesperrt",
"tokens.copy_now": "Kopiere den Token jetzt. Er wird nicht erneut angezeigt.", "tokens.copy_now": "Kopiere den Token jetzt. Er wird nicht erneut angezeigt.",
"tokens.create": "Token erstellen", "tokens.create": "Token erstellen",
"tokens.created": "Erstellt", "tokens.created": "Erstellt",
+26 -5
View File
@@ -60,6 +60,7 @@
"apidocs.hint": "\"Try it out\" uses your current session.", "apidocs.hint": "\"Try it out\" uses your current session.",
"apidocs.title": "API documentation", "apidocs.title": "API documentation",
"app.network_error": "Connection failed.", "app.network_error": "Connection failed.",
"audit.action.account.consent": "Privacy policy and terms accepted",
"audit.action.account.delete": "Account deleted", "audit.action.account.delete": "Account deleted",
"audit.action.account.export": "Personal data exported", "audit.action.account.export": "Personal data exported",
"audit.action.account.identity_link": "Sign-in provider connected", "audit.action.account.identity_link": "Sign-in provider connected",
@@ -474,6 +475,16 @@
"common.no": "no", "common.no": "no",
"common.save": "Save", "common.save": "Save",
"common.yes": "yes", "common.yes": "yes",
"consent.accept_prefix": "I have read and accept the",
"consent.accept_suffix": ".",
"consent.and": "and the",
"consent.decline": "If you do not agree, you can take your data with you and delete your account.",
"consent.doc.privacy": "privacy policy",
"consent.doc.terms": "terms of service",
"consent.intro": "To continue, please read and accept these documents. They are new or have changed since you last accepted them.",
"consent.sso_hint": "Signing up with a provider asks for your consent right after the first sign-in.",
"consent.submit": "Accept and continue",
"consent.title": "Please accept our terms",
"console.monitors.empty": "No monitors yet.", "console.monitors.empty": "No monitors yet.",
"console.monitors.title": "Monitors", "console.monitors.title": "Monitors",
"console.nav.admin": "Admin", "console.nav.admin": "Admin",
@@ -508,6 +519,8 @@
"error.channel_type_immutable": "The type of a channel cannot be changed.", "error.channel_type_immutable": "The type of a channel cannot be changed.",
"error.check_type_disabled": "This check type is switched off for this organization or installation.", "error.check_type_disabled": "This check type is switched off for this organization or installation.",
"error.confirmation_failed": "The confirmation does not match.", "error.confirmation_failed": "The confirmation does not match.",
"error.consent_outdated": "The documents changed in the meantime. Reload the page and accept the current version.",
"error.consent_required": "Please accept the privacy policy and terms first.",
"error.domain_not_verified": "The TXT record was not found yet. DNS changes can take a while to appear.", "error.domain_not_verified": "The TXT record was not found yet. DNS changes can take a while to appear.",
"error.domain_taken": "This domain is already used by another status page.", "error.domain_taken": "This domain is already used by another status page.",
"error.email_not_configured": "Email is not available on this server.", "error.email_not_configured": "Email is not available on this server.",
@@ -577,7 +590,6 @@
"error.org_suspended": "The operator suspended this organization.", "error.org_suspended": "The operator suspended this organization.",
"error.owner_cannot_be_removed": "The owner cannot be removed.", "error.owner_cannot_be_removed": "The owner cannot be removed.",
"error.owner_has_all_permissions": "The owner already has every permission.", "error.owner_has_all_permissions": "The owner already has every permission.",
"error.owns_shared_orgs": "You own organizations with other members. Hand them over or delete them first.",
"error.password_too_short": "The password needs at least {{.Min}} characters.", "error.password_too_short": "The password needs at least {{.Min}} characters.",
"error.permission_escalation": "You cannot grant permissions you do not hold yourself.", "error.permission_escalation": "You cannot grant permissions you do not hold yourself.",
"error.platform_region_limit": "A monitor may be checked from at most {{.Max}} platform regions; your own checker regions do not count.", "error.platform_region_limit": "A monitor may be checked from at most {{.Max}} platform regions; your own checker regions do not count.",
@@ -619,7 +631,6 @@
"error.totp_setup_expired": "Setup expired, please start again.", "error.totp_setup_expired": "Setup expired, please start again.",
"error.unauthenticated": "Authentication required.", "error.unauthenticated": "Authentication required.",
"error.unsupported_locale": "Unsupported language.", "error.unsupported_locale": "Unsupported language.",
"error.user_owns_shared_orgs": "The account owns organizations with other members. Delete those or hand them over first.",
"error.verification_expired": "This confirmation link is invalid or expired. Ask for a new one.", "error.verification_expired": "This confirmation link is invalid or expired. Ask for a new one.",
"error.verification_mail_failed": "Your account was created, but the confirmation email could not be sent. Ask for a new link in a while.", "error.verification_mail_failed": "Your account was created, but the confirmation email could not be sent. Ask for a new link in a while.",
"evidence.body": "Response body", "evidence.body": "Response body",
@@ -662,6 +673,7 @@
"export.account_title": "Personal data export", "export.account_title": "Personal data export",
"export.download_json": "Download JSON", "export.download_json": "Download JSON",
"export.download_pdf": "Download PDF", "export.download_pdf": "Download PDF",
"export.field.accepted_at": "Accepted at",
"export.field.account": "Account", "export.field.account": "Account",
"export.field.action": "Action", "export.field.action": "Action",
"export.field.activity": "Activity", "export.field.activity": "Activity",
@@ -676,6 +688,7 @@
"export.field.client_id": "Client ID", "export.field.client_id": "Client ID",
"export.field.config": "Configuration", "export.field.config": "Configuration",
"export.field.confirmations": "Confirmations", "export.field.confirmations": "Confirmations",
"export.field.consents": "Accepted documents",
"export.field.created_at": "Created", "export.field.created_at": "Created",
"export.field.custom_domain": "Custom domain", "export.field.custom_domain": "Custom domain",
"export.field.custom_roles": "Custom roles", "export.field.custom_roles": "Custom roles",
@@ -745,6 +758,7 @@
"export.field.totp_enabled_at": "Two-factor enabled", "export.field.totp_enabled_at": "Two-factor enabled",
"export.field.type": "Type", "export.field.type": "Type",
"export.field.user_agent": "Browser", "export.field.user_agent": "Browser",
"export.field.version": "Version",
"export.json_only": "Included in the JSON export only.", "export.json_only": "Included in the JSON export only.",
"export.no": "no", "export.no": "no",
"export.none": "None.", "export.none": "None.",
@@ -754,10 +768,11 @@
"gdpr.account_export_intro": "Download everything stored about you: profile, memberships, sign-in identities, API tokens and your activity. JSON is machine-readable, PDF easy to read.", "gdpr.account_export_intro": "Download everything stored about you: profile, memberships, sign-in identities, API tokens and your activity. JSON is machine-readable, PDF easy to read.",
"gdpr.delete_account": "Delete account", "gdpr.delete_account": "Delete account",
"gdpr.delete_account_confirm": "Delete your account permanently? This cannot be undone.", "gdpr.delete_account_confirm": "Delete your account permanently? This cannot be undone.",
"gdpr.delete_account_intro": "Deletes your account immediately and signs you out everywhere. Organizations only you belong to are deleted with it. Organizations you own together with others must be handed over or deleted first. Audit entries in other organizations remain, showing \"deleted user\".", "gdpr.delete_account_intro": "Deletes your account immediately and signs you out everywhere. Organizations you own are deleted with it, with everything in them, also for their other members; the others you just leave. Audit entries in other organizations remain, showing \"deleted user\".",
"gdpr.delete_org": "Delete organization", "gdpr.delete_org": "Delete organization",
"gdpr.delete_org_confirm": "Delete this organization and all its data permanently?", "gdpr.delete_org_confirm": "Delete this organization and all its data permanently?",
"gdpr.delete_org_intro": "Deletes the organization with all monitors, check results, status pages, members' access and API tokens, immediately and permanently. Members' accounts remain.", "gdpr.delete_org_intro": "Deletes the organization with all monitors, check results, status pages, members' access and API tokens, immediately and permanently. Members' accounts remain.",
"gdpr.deletes_orgs": "You own these organizations. They are deleted with your account, with all their monitors and status pages, also for their other members:",
"gdpr.org_data": "Organization data", "gdpr.org_data": "Organization data",
"gdpr.org_export_intro": "Download members, roles, monitors, groups, channels, status pages, SSO settings, incidents, the audit log and daily statistics. Secrets are not included.", "gdpr.org_export_intro": "Download members, roles, monitors, groups, channels, status pages, SSO settings, incidents, the audit log and daily statistics. Secrets are not included.",
"gdpr.password": "Your password", "gdpr.password": "Your password",
@@ -803,11 +818,14 @@
"legal.hint": "A link takes precedence over the text. Leave both empty to remove the document.", "legal.hint": "A link takes precedence over the text. Leave both empty to remove the document.",
"legal.imprint": "Legal notice", "legal.imprint": "Legal notice",
"legal.markdown": "Or text (Markdown)", "legal.markdown": "Or text (Markdown)",
"legal.new_version": "Everyone has to accept it again",
"legal.new_version_hint": "For material changes: every account is asked to accept the new version at its next request and can use nothing else until then. Leave it off for corrections.",
"legal.org_intro": "Shown on your organization's status pages. Without your own documents, the platform's are shown.", "legal.org_intro": "Shown on your organization's status pages. Without your own documents, the platform's are shown.",
"legal.org_title": "Legal notice & privacy", "legal.org_title": "Legal notice & privacy",
"legal.platform_intro": "Linked in the footer of the console and sign-in pages, and on status pages of organizations without their own documents.", "legal.platform_intro": "Linked in the footer of the console and sign-in pages; legal notice and privacy policy also on status pages of organizations without their own. Every account accepts the privacy policy and terms when signing up, and again when you ask for it.",
"legal.platform_title": "Platform legal notice & privacy", "legal.platform_title": "Platform legal notice, privacy & terms",
"legal.privacy": "Privacy policy", "legal.privacy": "Privacy policy",
"legal.terms": "Terms of service",
"legal.url": "Link to an existing page", "legal.url": "Link to an existing page",
"limits.default": "default: {{.Value}}", "limits.default": "default: {{.Value}}",
"limits.intro": "Apply to every organization and account without an override of its own, also when you change them later. 0 means unlimited. Lowering a limit keeps everything that exists; only new monitors, status pages, regions or organizations are refused.", "limits.intro": "Apply to every organization and account without an override of its own, also when you change them later. 0 means unlimited. Lowering a limit keeps everything that exists; only new monitors, status pages, regions or organizations are refused.",
@@ -1309,6 +1327,9 @@
"storage.retention": "Delete after", "storage.retention": "Delete after",
"storage.size": "Size", "storage.size": "Size",
"storage.title": "Data storage", "storage.title": "Data storage",
"suspended.intro": "The platform's administrators have suspended your account.",
"suspended.options": "You can still download your data or delete your account.",
"suspended.title": "Account suspended",
"tokens.copy_now": "Copy the token now. It will not be shown again.", "tokens.copy_now": "Copy the token now. It will not be shown again.",
"tokens.create": "Create token", "tokens.create": "Create token",
"tokens.created": "Created", "tokens.created": "Created",
@@ -0,0 +1,40 @@
-- +goose Up
-- Terms of service join the legal documents, for the platform only: status
-- page visitors accept nothing.
ALTER TABLE legal_documents DROP CONSTRAINT legal_documents_kind_check;
ALTER TABLE legal_documents ADD CONSTRAINT legal_documents_kind_check
CHECK (kind IN ('imprint', 'privacy', 'terms'));
ALTER TABLE legal_documents ADD CONSTRAINT legal_documents_terms_platform
CHECK (kind <> 'terms' OR org_id IS NULL);
-- version identifies the text users accept. It changes when a document is
-- created or when an edit asks everyone to accept again, and comes from a
-- sequence so a document removed and written anew never repeats one.
CREATE SEQUENCE legal_document_versions;
ALTER TABLE legal_documents ADD COLUMN version bigint NOT NULL DEFAULT nextval('legal_document_versions');
-- Which version of the platform's privacy policy and terms each account
-- accepted, and when: the proof of consent.
CREATE TABLE legal_acceptances (
user_id uuid NOT NULL REFERENCES users (id) ON DELETE CASCADE,
kind text NOT NULL CHECK (kind IN ('privacy', 'terms')),
version bigint NOT NULL,
accepted_at timestamptz NOT NULL DEFAULT now(),
PRIMARY KEY (user_id, kind, version)
);
ALTER TABLE legal_acceptances ENABLE ROW LEVEL SECURITY;
ALTER TABLE legal_acceptances FORCE ROW LEVEL SECURITY;
CREATE POLICY legal_acceptances_own ON legal_acceptances FOR ALL
USING (app_scope_system() OR user_id = app_user_id())
WITH CHECK (app_scope_system() OR user_id = app_user_id());
-- +goose Down
DROP TABLE legal_acceptances;
ALTER TABLE legal_documents DROP COLUMN version;
DROP SEQUENCE legal_document_versions;
DELETE FROM legal_documents WHERE kind = 'terms';
ALTER TABLE legal_documents DROP CONSTRAINT legal_documents_terms_platform;
ALTER TABLE legal_documents DROP CONSTRAINT legal_documents_kind_check;
ALTER TABLE legal_documents ADD CONSTRAINT legal_documents_kind_check
CHECK (kind IN ('imprint', 'privacy'));
+116 -2
View File
@@ -7,10 +7,56 @@ package store
import ( import (
"context" "context"
"time"
"github.com/google/uuid" "github.com/google/uuid"
) )
const acceptLegal = `-- name: AcceptLegal :exec
INSERT INTO legal_acceptances (user_id, kind, version) VALUES ($1, $2, $3)
ON CONFLICT DO NOTHING
`
type AcceptLegalParams struct {
UserID uuid.UUID
Kind string
Version int64
}
func (q *Queries) AcceptLegal(ctx context.Context, arg AcceptLegalParams) error {
_, err := q.db.Exec(ctx, acceptLegal, arg.UserID, arg.Kind, arg.Version)
return err
}
const acceptedLegalVersions = `-- name: AcceptedLegalVersions :many
SELECT kind, version FROM legal_acceptances WHERE user_id = $1
`
type AcceptedLegalVersionsRow struct {
Kind string
Version int64
}
func (q *Queries) AcceptedLegalVersions(ctx context.Context, userID uuid.UUID) ([]AcceptedLegalVersionsRow, error) {
rows, err := q.db.Query(ctx, acceptedLegalVersions, userID)
if err != nil {
return nil, err
}
defer rows.Close()
items := []AcceptedLegalVersionsRow{}
for rows.Next() {
var i AcceptedLegalVersionsRow
if err := rows.Scan(&i.Kind, &i.Version); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const deleteLegalDocument = `-- name: DeleteLegalDocument :exec const deleteLegalDocument = `-- name: DeleteLegalDocument :exec
DELETE FROM legal_documents WHERE org_id IS NOT DISTINCT FROM $1 AND kind = $2 DELETE FROM legal_documents WHERE org_id IS NOT DISTINCT FROM $1 AND kind = $2
` `
@@ -25,8 +71,38 @@ func (q *Queries) DeleteLegalDocument(ctx context.Context, arg DeleteLegalDocume
return err return err
} }
const legalAcceptances = `-- name: LegalAcceptances :many
SELECT kind, version, accepted_at FROM legal_acceptances WHERE user_id = $1 ORDER BY accepted_at, kind
`
type LegalAcceptancesRow struct {
Kind string
Version int64
AcceptedAt time.Time
}
func (q *Queries) LegalAcceptances(ctx context.Context, userID uuid.UUID) ([]LegalAcceptancesRow, error) {
rows, err := q.db.Query(ctx, legalAcceptances, userID)
if err != nil {
return nil, err
}
defer rows.Close()
items := []LegalAcceptancesRow{}
for rows.Next() {
var i LegalAcceptancesRow
if err := rows.Scan(&i.Kind, &i.Version, &i.AcceptedAt); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const legalDocuments = `-- name: LegalDocuments :many const legalDocuments = `-- name: LegalDocuments :many
SELECT org_id, kind, url, markdown, updated_at FROM legal_documents SELECT org_id, kind, url, markdown, updated_at, version FROM legal_documents
WHERE org_id IS NULL OR org_id = $1 WHERE org_id IS NULL OR org_id = $1
ORDER BY org_id NULLS LAST, kind ORDER BY org_id NULLS LAST, kind
` `
@@ -47,6 +123,7 @@ func (q *Queries) LegalDocuments(ctx context.Context, orgID *uuid.UUID) ([]Legal
&i.Url, &i.Url,
&i.Markdown, &i.Markdown,
&i.UpdatedAt, &i.UpdatedAt,
&i.Version,
); err != nil { ); err != nil {
return nil, err return nil, err
} }
@@ -58,10 +135,43 @@ func (q *Queries) LegalDocuments(ctx context.Context, orgID *uuid.UUID) ([]Legal
return items, nil return items, nil
} }
const requiredLegalVersions = `-- name: RequiredLegalVersions :many
SELECT kind, version FROM legal_documents
WHERE org_id IS NULL AND kind IN ('privacy', 'terms') AND (url <> '' OR markdown <> '')
ORDER BY kind
`
type RequiredLegalVersionsRow struct {
Kind string
Version int64
}
// The platform documents accounts have to accept, in their current version.
func (q *Queries) RequiredLegalVersions(ctx context.Context) ([]RequiredLegalVersionsRow, error) {
rows, err := q.db.Query(ctx, requiredLegalVersions)
if err != nil {
return nil, err
}
defer rows.Close()
items := []RequiredLegalVersionsRow{}
for rows.Next() {
var i RequiredLegalVersionsRow
if err := rows.Scan(&i.Kind, &i.Version); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const upsertLegalDocument = `-- name: UpsertLegalDocument :exec const upsertLegalDocument = `-- name: UpsertLegalDocument :exec
INSERT INTO legal_documents (org_id, kind, url, markdown) INSERT INTO legal_documents (org_id, kind, url, markdown)
VALUES ($1, $2, $3, $4) VALUES ($1, $2, $3, $4)
ON CONFLICT (org_id, kind) DO UPDATE SET url = EXCLUDED.url, markdown = EXCLUDED.markdown, updated_at = now() ON CONFLICT (org_id, kind) DO UPDATE SET url = EXCLUDED.url, markdown = EXCLUDED.markdown, updated_at = now(),
version = CASE WHEN $5::boolean THEN nextval('legal_document_versions') ELSE legal_documents.version END
` `
type UpsertLegalDocumentParams struct { type UpsertLegalDocumentParams struct {
@@ -69,14 +179,18 @@ type UpsertLegalDocumentParams struct {
Kind string Kind string
Url string Url string
Markdown string Markdown string
NewVersion bool
} }
// A new version starts when the document is created or when the edit asks
// everyone to accept it again.
func (q *Queries) UpsertLegalDocument(ctx context.Context, arg UpsertLegalDocumentParams) error { func (q *Queries) UpsertLegalDocument(ctx context.Context, arg UpsertLegalDocumentParams) error {
_, err := q.db.Exec(ctx, upsertLegalDocument, _, err := q.db.Exec(ctx, upsertLegalDocument,
arg.OrgID, arg.OrgID,
arg.Kind, arg.Kind,
arg.Url, arg.Url,
arg.Markdown, arg.Markdown,
arg.NewVersion,
) )
return err return err
} }
+8
View File
@@ -174,12 +174,20 @@ type Invitation struct {
CreatedAt time.Time CreatedAt time.Time
} }
type LegalAcceptance struct {
UserID uuid.UUID
Kind string
Version int64
AcceptedAt time.Time
}
type LegalDocument struct { type LegalDocument struct {
OrgID *uuid.UUID OrgID *uuid.UUID
Kind string Kind string
Url string Url string
Markdown string Markdown string
UpdatedAt time.Time UpdatedAt time.Time
Version int64
} }
type MaintenanceTarget struct { type MaintenanceTarget struct {
+7
View File
@@ -13,6 +13,8 @@ import (
type Querier interface { type Querier interface {
APITokenOrg(ctx context.Context, hash []byte) (uuid.UUID, error) APITokenOrg(ctx context.Context, hash []byte) (uuid.UUID, error)
AcceptLegal(ctx context.Context, arg AcceptLegalParams) error
AcceptedLegalVersions(ctx context.Context, userID uuid.UUID) ([]AcceptedLegalVersionsRow, error)
AddAlertGroupChannel(ctx context.Context, arg AddAlertGroupChannelParams) (int64, error) AddAlertGroupChannel(ctx context.Context, arg AddAlertGroupChannelParams) (int64, error)
AddMaintenanceTarget(ctx context.Context, arg AddMaintenanceTargetParams) error AddMaintenanceTarget(ctx context.Context, arg AddMaintenanceTargetParams) error
AddMembership(ctx context.Context, arg AddMembershipParams) error AddMembership(ctx context.Context, arg AddMembershipParams) error
@@ -179,6 +181,7 @@ type Querier interface {
// Newest result per monitor and region in the org. // Newest result per monitor and region in the org.
LatestResults(ctx context.Context, orgID uuid.UUID) ([]LatestResultsRow, error) LatestResults(ctx context.Context, orgID uuid.UUID) ([]LatestResultsRow, error)
LatestResultsForMonitor(ctx context.Context, arg LatestResultsForMonitorParams) ([]LatestResultsForMonitorRow, error) LatestResultsForMonitor(ctx context.Context, arg LatestResultsForMonitorParams) ([]LatestResultsForMonitorRow, error)
LegalAcceptances(ctx context.Context, userID uuid.UUID) ([]LegalAcceptancesRow, error)
// The organization's documents and the platform's, organization first. // The organization's documents and the platform's, organization first.
LegalDocuments(ctx context.Context, orgID *uuid.UUID) ([]LegalDocument, error) LegalDocuments(ctx context.Context, orgID *uuid.UUID) ([]LegalDocument, error)
ListAPITokens(ctx context.Context, arg ListAPITokensParams) ([]ListAPITokensRow, error) ListAPITokens(ctx context.Context, arg ListAPITokensParams) ([]ListAPITokensRow, error)
@@ -293,6 +296,8 @@ type Querier interface {
ReparentGroups(ctx context.Context, arg ReparentGroupsParams) error ReparentGroups(ctx context.Context, arg ReparentGroupsParams) error
ReparentStatusPageGroupChildren(ctx context.Context, arg ReparentStatusPageGroupChildrenParams) error ReparentStatusPageGroupChildren(ctx context.Context, arg ReparentStatusPageGroupChildrenParams) error
ReparentStatusPageGroupMonitors(ctx context.Context, arg ReparentStatusPageGroupMonitorsParams) error ReparentStatusPageGroupMonitors(ctx context.Context, arg ReparentStatusPageGroupMonitorsParams) error
// The platform documents accounts have to accept, in their current version.
RequiredLegalVersions(ctx context.Context) ([]RequiredLegalVersionsRow, error)
ResolveIncident(ctx context.Context, arg ResolveIncidentParams) (Incident, error) ResolveIncident(ctx context.Context, arg ResolveIncidentParams) (Incident, error)
// Heartbeats of an organization wait afresh after its suspension, during // Heartbeats of an organization wait afresh after its suspension, during
// which pings were refused. // which pings were refused.
@@ -343,6 +348,8 @@ type Querier interface {
UpdateStatusPage(ctx context.Context, arg UpdateStatusPageParams) (StatusPage, error) UpdateStatusPage(ctx context.Context, arg UpdateStatusPageParams) (StatusPage, error)
UpdateStatusPageGroup(ctx context.Context, arg UpdateStatusPageGroupParams) (StatusPageGroup, error) UpdateStatusPageGroup(ctx context.Context, arg UpdateStatusPageGroupParams) (StatusPageGroup, error)
UpsertAlertmanagerAlert(ctx context.Context, arg UpsertAlertmanagerAlertParams) error UpsertAlertmanagerAlert(ctx context.Context, arg UpsertAlertmanagerAlertParams) error
// A new version starts when the document is created or when the edit asks
// everyone to accept it again.
UpsertLegalDocument(ctx context.Context, arg UpsertLegalDocumentParams) error UpsertLegalDocument(ctx context.Context, arg UpsertLegalDocumentParams) error
// Uptime per monitor from the hourly aggregate, including the not yet // Uptime per monitor from the hourly aggregate, including the not yet
// materialized most recent hours (real-time aggregation). // materialized most recent hours (real-time aggregation).
+21 -2
View File
@@ -1,13 +1,32 @@
-- name: UpsertLegalDocument :exec -- name: UpsertLegalDocument :exec
-- A new version starts when the document is created or when the edit asks
-- everyone to accept it again.
INSERT INTO legal_documents (org_id, kind, url, markdown) INSERT INTO legal_documents (org_id, kind, url, markdown)
VALUES ($1, $2, $3, $4) VALUES ($1, $2, $3, $4)
ON CONFLICT (org_id, kind) DO UPDATE SET url = EXCLUDED.url, markdown = EXCLUDED.markdown, updated_at = now(); ON CONFLICT (org_id, kind) DO UPDATE SET url = EXCLUDED.url, markdown = EXCLUDED.markdown, updated_at = now(),
version = CASE WHEN sqlc.arg(new_version)::boolean THEN nextval('legal_document_versions') ELSE legal_documents.version END;
-- name: DeleteLegalDocument :exec -- name: DeleteLegalDocument :exec
DELETE FROM legal_documents WHERE org_id IS NOT DISTINCT FROM $1 AND kind = $2; DELETE FROM legal_documents WHERE org_id IS NOT DISTINCT FROM $1 AND kind = $2;
-- name: LegalDocuments :many -- name: LegalDocuments :many
-- The organization's documents and the platform's, organization first. -- The organization's documents and the platform's, organization first.
SELECT org_id, kind, url, markdown, updated_at FROM legal_documents SELECT org_id, kind, url, markdown, updated_at, version FROM legal_documents
WHERE org_id IS NULL OR org_id = sqlc.narg(org_id) WHERE org_id IS NULL OR org_id = sqlc.narg(org_id)
ORDER BY org_id NULLS LAST, kind; ORDER BY org_id NULLS LAST, kind;
-- name: RequiredLegalVersions :many
-- The platform documents accounts have to accept, in their current version.
SELECT kind, version FROM legal_documents
WHERE org_id IS NULL AND kind IN ('privacy', 'terms') AND (url <> '' OR markdown <> '')
ORDER BY kind;
-- name: AcceptedLegalVersions :many
SELECT kind, version FROM legal_acceptances WHERE user_id = $1;
-- name: AcceptLegal :exec
INSERT INTO legal_acceptances (user_id, kind, version) VALUES ($1, $2, $3)
ON CONFLICT DO NOTHING;
-- name: LegalAcceptances :many
SELECT kind, version, accepted_at FROM legal_acceptances WHERE user_id = $1 ORDER BY accepted_at, kind;
+98 -1
View File
@@ -66,7 +66,40 @@ templ Login(p Page, signupAllowed bool, next string, providers []IDPButton, mfa
// Signup offers the providers people may sign up through and, if email // Signup offers the providers people may sign up through and, if email
// is set, the form for signing up with email and password. // is set, the form for signing up with email and password.
templ Signup(p Page, providers []IDPButton, email bool) { // SignupConsent lists the documents a new account accepts and their
// versions, empty when the platform has none.
type SignupConsent struct {
Docs []LegalLink
Versions string
}
// consentLinks names the documents as links, opening in a new tab so a
// half-filled form survives reading them.
templ consentLinks(docs []LegalLink) {
for i, d := range docs {
if i > 0 {
{ i18n.T(ctx, "consent.and") }
}
<a href={ templ.SafeURL(d.Href) } target="_blank" rel="noopener" class="underline underline-offset-2">{ i18n.T(ctx, "consent.doc."+d.Kind) }</a>
}
}
// consentField is the checkbox a sign-up form needs ticked.
templ consentField(c SignupConsent) {
if len(c.Docs) > 0 {
<input type="hidden" name="consent_versions" value={ c.Versions }/>
<label class="mb-4 flex items-start gap-2 text-sm">
<input type="checkbox" name="consent" required class="mt-1 accent-ink"/>
<span>
{ i18n.T(ctx, "consent.accept_prefix") }
@consentLinks(c.Docs)
{ i18n.T(ctx, "consent.accept_suffix") }
</span>
</label>
}
}
templ Signup(p Page, providers []IDPButton, email bool, consent SignupConsent) {
@authShell(p) { @authShell(p) {
if email { if email {
@idpButtons(providers, "auth.sso.signup_with") @idpButtons(providers, "auth.sso.signup_with")
@@ -75,8 +108,12 @@ templ Signup(p Page, providers []IDPButton, email bool) {
@field(i18n.T(ctx, "auth.field.name"), "display_name", "text", "name", false) @field(i18n.T(ctx, "auth.field.name"), "display_name", "text", "name", false)
@field(i18n.T(ctx, "auth.field.email"), "email", "email", "username", true) @field(i18n.T(ctx, "auth.field.email"), "email", "email", "username", true)
@field(i18n.T(ctx, "auth.field.new_password", "Min", auth.MinPasswordLength), "password", "password", "new-password", true) @field(i18n.T(ctx, "auth.field.new_password", "Min", auth.MinPasswordLength), "password", "password", "new-password", true)
@consentField(consent)
@submit(i18n.T(ctx, "auth.signup.submit")) @submit(i18n.T(ctx, "auth.signup.submit"))
</form> </form>
if len(consent.Docs) > 0 && len(providers) > 0 {
<p class="mt-4 text-xs text-muted">{ i18n.T(ctx, "consent.sso_hint") }</p>
}
} else { } else {
<div class="grid gap-2"> <div class="grid gap-2">
for _, pr := range providers { for _, pr := range providers {
@@ -154,3 +191,63 @@ templ NewOrgPage(p Page, me Me) {
} }
} }
} }
// ConsentPage asks a signed-in account to accept the platform's documents,
// new or changed. Declining leaves exporting and deleting the account.
templ ConsentPage(p Page, me Me, docs []LegalLink, versions, next string) {
@Layout(p) {
<main class="mx-auto mt-[8vh] w-full max-w-xl px-6 pb-16">
<div class="mb-10 flex items-center justify-between">
@brandLockup("/consent")
@languageSwitch(p.Languages)
</div>
<h1 class="mb-4 text-xl font-semibold">{ i18n.T(ctx, p.TitleID) }</h1>
<p class="mb-6 text-sm">{ i18n.T(ctx, "consent.intro") }</p>
<ul class="mb-6 list-inside list-disc text-sm">
for _, d := range docs {
<li><a href={ templ.SafeURL(d.Href) } target="_blank" rel="noopener" class="underline underline-offset-2">{ i18n.T(ctx, LegalTitleID(d.Kind)) }</a></li>
}
</ul>
<form data-api="/consent" data-next={ next }>
@formError()
<input type="hidden" name="versions" value={ versions }/>
<input type="hidden" name="next" value={ next }/>
<label class="mb-4 flex items-start gap-2 text-sm">
<input type="checkbox" name="accept" required class="mt-1 accent-ink"/>
<span>
{ i18n.T(ctx, "consent.accept_prefix") }
@consentLinks(docs)
{ i18n.T(ctx, "consent.accept_suffix") }
</span>
</label>
@submit(i18n.T(ctx, "consent.submit"))
</form>
<p class="mt-6 text-sm"><button data-logout class="underline underline-offset-2">{ i18n.T(ctx, "console.nav.logout") }</button></p>
<div class="mt-12 border-t border-rule pt-6">
<p class="mb-6 text-sm text-muted">{ i18n.T(ctx, "consent.decline") }</p>
@accountDataBody(me)
</div>
</main>
}
}
// SuspendedPage is all a suspended account sees: why, and how to take its
// data along or delete it.
templ SuspendedPage(p Page, me Me, reason string) {
@Layout(p) {
<main class="mx-auto mt-[8vh] w-full max-w-xl px-6 pb-16">
<div class="mb-10 flex items-center justify-between">
@brandLockup("/account/suspended")
@languageSwitch(p.Languages)
</div>
<h1 class="mb-4 text-xl font-semibold">{ i18n.T(ctx, p.TitleID) }</h1>
<p class="mb-2 text-sm">{ i18n.T(ctx, "suspended.intro") }</p>
if reason != "" {
<p class="mb-6 border-l-2 border-down pl-3 text-sm">{ reason }</p>
}
<p class="mb-6 text-sm text-muted">{ i18n.T(ctx, "suspended.options") }</p>
<p class="mb-10 text-sm"><button data-logout class="underline underline-offset-2">{ i18n.T(ctx, "console.nav.logout") }</button></p>
@accountDataBody(me)
</main>
}
}
+658 -113
View File
File diff suppressed because it is too large. Load diff
+3
View File
@@ -27,6 +27,9 @@ type Me struct {
// organization, with SuspendedReason as they gave it. // organization, with SuspendedReason as they gave it.
OrgSuspended bool OrgSuspended bool
SuspendedReason string SuspendedReason string
// DeletesOrgs names the organizations the account owns; deleting it
// deletes them, with all their monitors.
DeletesOrgs []string
} }
// Org is one entry of the organization switcher. // Org is one entry of the organization switcher.
+49 -46
View File
@@ -36,6 +36,9 @@ type Me struct {
// organization, with SuspendedReason as they gave it. // organization, with SuspendedReason as they gave it.
OrgSuspended bool OrgSuspended bool
SuspendedReason string SuspendedReason string
// DeletesOrgs names the organizations the account owns; deleting it
// deletes them, with all their monitors.
DeletesOrgs []string
} }
// Org is one entry of the organization switcher. // Org is one entry of the organization switcher.
@@ -97,7 +100,7 @@ func consoleShell(p Page, me Me) templ.Component {
var templ_7745c5c3_Var3 string var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templruntime.NewAttributeExpression(o.ID).Resolve(ctx) templ_7745c5c3_Var3, templ_7745c5c3_Err = templruntime.NewAttributeExpression(o.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 48, Col: 27} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 51, Col: 27}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var3) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var3)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -120,7 +123,7 @@ func consoleShell(p Page, me Me) templ.Component {
var templ_7745c5c3_Var4 string var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(o.Name) templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(o.Name)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 48, Col: 73} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 51, Col: 73}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -143,7 +146,7 @@ func consoleShell(p Page, me Me) templ.Component {
var templ_7745c5c3_Var5 string var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(me.Orgs[0].Name) templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(me.Orgs[0].Name)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 52, Col: 47} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 55, Col: 47}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -161,7 +164,7 @@ func consoleShell(p Page, me Me) templ.Component {
var templ_7745c5c3_Var6 string var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "orgs.new_title")).Resolve(ctx) templ_7745c5c3_Var6, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "orgs.new_title")).Resolve(ctx)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 54, Col: 101} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 57, Col: 101}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var6) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var6)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -174,7 +177,7 @@ func consoleShell(p Page, me Me) templ.Component {
var templ_7745c5c3_Var7 string var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "orgs.new_title")).Resolve(ctx) templ_7745c5c3_Var7, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "orgs.new_title")).Resolve(ctx)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 54, Col: 146} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 57, Col: 146}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -187,7 +190,7 @@ func consoleShell(p Page, me Me) templ.Component {
var templ_7745c5c3_Var8 string var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.monitors.title")) templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.monitors.title"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 56, Col: 90} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 59, Col: 90}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -205,7 +208,7 @@ func consoleShell(p Page, me Me) templ.Component {
var templ_7745c5c3_Var9 string var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.title")) templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "pages.title"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 58, Col: 91} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 61, Col: 91}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -224,7 +227,7 @@ func consoleShell(p Page, me Me) templ.Component {
var templ_7745c5c3_Var10 string var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incidents.title")) templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "incidents.title"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 61, Col: 93} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 64, Col: 93}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -237,7 +240,7 @@ func consoleShell(p Page, me Me) templ.Component {
var templ_7745c5c3_Var11 string var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "maintenance.title")) templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "maintenance.title"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 62, Col: 97} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 65, Col: 97}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -255,7 +258,7 @@ func consoleShell(p Page, me Me) templ.Component {
var templ_7745c5c3_Var12 string var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.nav.settings")) templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.nav.settings"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 66, Col: 96} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 69, Col: 96}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -273,7 +276,7 @@ func consoleShell(p Page, me Me) templ.Component {
var templ_7745c5c3_Var13 string var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.nav.admin")) templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.nav.admin"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 68, Col: 93} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 71, Col: 93}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -291,7 +294,7 @@ func consoleShell(p Page, me Me) templ.Component {
var templ_7745c5c3_Var14 string var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.nav.logout")) templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.nav.logout"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 70, Col: 94} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 73, Col: 94}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -317,7 +320,7 @@ func consoleShell(p Page, me Me) templ.Component {
var templ_7745c5c3_Var15 string var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.org_suspended")) templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.org_suspended"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 78, Col: 51} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 81, Col: 51}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -331,7 +334,7 @@ func consoleShell(p Page, me Me) templ.Component {
var templ_7745c5c3_Var16 string var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(" " + i18n.T(ctx, "console.suspended_reason", "Reason", me.SuspendedReason)) templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(" " + i18n.T(ctx, "console.suspended_reason", "Reason", me.SuspendedReason))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 80, Col: 83} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 83, Col: 83}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -439,7 +442,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var19 string var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.title")) templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.title"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 118, Col: 72} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 121, Col: 72}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -452,7 +455,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var20 string var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.heading")) templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.heading"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 120, Col: 114} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 123, Col: 114}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -470,7 +473,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var21 string var templ_7745c5c3_Var21 string
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.active")) templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.active"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 122, Col: 98} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 125, Col: 98}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -523,7 +526,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var24 string var templ_7745c5c3_Var24 string
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.recovery.left", "Count", me.RecoveryCodesLeft)) templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.recovery.left", "Count", me.RecoveryCodesLeft))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 124, Col: 75} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 127, Col: 75}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -536,7 +539,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var25 string var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.recovery.regenerate")) templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.recovery.regenerate"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 127, Col: 116} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 130, Col: 116}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -573,7 +576,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var26 string var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.disable")) templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.disable"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 137, Col: 109} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 140, Col: 109}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -611,7 +614,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var27 string var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.inactive")) templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.inactive"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 146, Col: 105} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 149, Col: 105}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -624,7 +627,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var28 string var templ_7745c5c3_Var28 string
templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.start")) templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.totp.start"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 148, Col: 141} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 151, Col: 141}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -637,7 +640,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var29 string var templ_7745c5c3_Var29 string
templ_7745c5c3_Var29, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "security.totp.qr_alt")).Resolve(ctx) templ_7745c5c3_Var29, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "security.totp.qr_alt")).Resolve(ctx)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 150, Col: 65} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 153, Col: 65}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var29) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var29)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -675,7 +678,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var30 string var templ_7745c5c3_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.sso.heading")) templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.sso.heading"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 163, Col: 113} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 166, Col: 113}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -693,7 +696,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var31 string var templ_7745c5c3_Var31 string
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.sso.none")) templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.sso.none"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 165, Col: 73} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 168, Col: 73}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -716,7 +719,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var32 string var templ_7745c5c3_Var32 string
templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(id.Provider) templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(id.Provider)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 169, Col: 69} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 172, Col: 69}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -729,7 +732,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var33 string var templ_7745c5c3_Var33 string
templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(id.Email) templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(id.Email)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 169, Col: 131} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 172, Col: 131}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -753,7 +756,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var34 string var templ_7745c5c3_Var34 string
templ_7745c5c3_Var34, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL("/sso/" + me.ActiveSlug + "?link=1")).ResolveURL(ctx) templ_7745c5c3_Var34, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL("/sso/" + me.ActiveSlug + "?link=1")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 174, Col: 64} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 177, Col: 64}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var34) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var34)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -766,7 +769,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var35 string var templ_7745c5c3_Var35 string
templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.sso.link")) templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.sso.link"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 174, Col: 190} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 177, Col: 190}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -789,7 +792,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var36 string var templ_7745c5c3_Var36 string
templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.platform_sso.heading")) templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.platform_sso.heading"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 179, Col: 123} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 182, Col: 123}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -812,7 +815,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var37 string var templ_7745c5c3_Var37 string
templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(l.Name) templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(l.Name)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 185, Col: 17} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 188, Col: 17}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -825,7 +828,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var38 string var templ_7745c5c3_Var38 string
templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.JoinStringErrs(l.Email) templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.JoinStringErrs(l.Email)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 186, Col: 67} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 189, Col: 67}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var38)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var38))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -838,7 +841,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var39 string var templ_7745c5c3_Var39 string
templ_7745c5c3_Var39, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/me/identities/" + l.ProviderID).Resolve(ctx) templ_7745c5c3_Var39, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/me/identities/" + l.ProviderID).Resolve(ctx)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 190, Col: 55} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 193, Col: 55}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var39) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var39)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -851,7 +854,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var40 string var templ_7745c5c3_Var40 string
templ_7745c5c3_Var40, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "security.platform_sso.unlink_confirm", "Name", l.Name)).Resolve(ctx) templ_7745c5c3_Var40, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "security.platform_sso.unlink_confirm", "Name", l.Name)).Resolve(ctx)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 191, Col: 91} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 194, Col: 91}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var40) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var40)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -864,7 +867,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var41 string var templ_7745c5c3_Var41 string
templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.platform_sso.unlink")) templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.platform_sso.unlink"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 193, Col: 54} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 196, Col: 54}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -892,7 +895,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var42 string var templ_7745c5c3_Var42 string
templ_7745c5c3_Var42, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(a.URL)).ResolveURL(ctx) templ_7745c5c3_Var42, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(a.URL)).ResolveURL(ctx)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 200, Col: 36} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 203, Col: 36}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var42) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var42)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -905,7 +908,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var43 string var templ_7745c5c3_Var43 string
templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.platform_sso.link", "Name", a.Name)) templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.platform_sso.link", "Name", a.Name))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 200, Col: 174} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 203, Col: 174}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -936,7 +939,7 @@ func Security(p Page, me Me, identities []Identity, canLink bool, activity []Aud
var templ_7745c5c3_Var44 string var templ_7745c5c3_Var44 string
templ_7745c5c3_Var44, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.activity_intro")) templ_7745c5c3_Var44, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.activity_intro"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 207, Col: 88} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 210, Col: 88}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var44)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var44))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -994,7 +997,7 @@ func recoveryOutput() templ.Component {
var templ_7745c5c3_Var46 string var templ_7745c5c3_Var46 string
templ_7745c5c3_Var46, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.recovery.save_now")) templ_7745c5c3_Var46, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.recovery.save_now"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 218, Col: 69} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 221, Col: 69}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var46)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var46))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -1007,7 +1010,7 @@ func recoveryOutput() templ.Component {
var templ_7745c5c3_Var47 string var templ_7745c5c3_Var47 string
templ_7745c5c3_Var47, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.recovery.saved")) templ_7745c5c3_Var47, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "security.recovery.saved"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 220, Col: 116} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 223, Col: 116}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var47)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var47))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -1045,7 +1048,7 @@ func policyBanner(msgID, actionID, href string) templ.Component {
var templ_7745c5c3_Var49 string var templ_7745c5c3_Var49 string
templ_7745c5c3_Var49, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, msgID)) templ_7745c5c3_Var49, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, msgID))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 227, Col: 23} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 230, Col: 23}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var49)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var49))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -1058,7 +1061,7 @@ func policyBanner(msgID, actionID, href string) templ.Component {
var templ_7745c5c3_Var50 string var templ_7745c5c3_Var50 string
templ_7745c5c3_Var50, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(href)).ResolveURL(ctx) templ_7745c5c3_Var50, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(href)).ResolveURL(ctx)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 228, Col: 32} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 231, Col: 32}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var50) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var50)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -1071,7 +1074,7 @@ func policyBanner(msgID, actionID, href string) templ.Component {
var templ_7745c5c3_Var51 string var templ_7745c5c3_Var51 string
templ_7745c5c3_Var51, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, actionID)) templ_7745c5c3_Var51, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, actionID))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 228, Col: 95} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 231, Col: 95}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var51)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var51))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -1109,7 +1112,7 @@ func settingsLink(href, titleID, hintID string) templ.Component {
var templ_7745c5c3_Var53 string var templ_7745c5c3_Var53 string
templ_7745c5c3_Var53, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(href)).ResolveURL(ctx) templ_7745c5c3_Var53, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(href)).ResolveURL(ctx)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 234, Col: 30} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 237, Col: 30}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var53) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var53)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -1122,7 +1125,7 @@ func settingsLink(href, titleID, hintID string) templ.Component {
var templ_7745c5c3_Var54 string var templ_7745c5c3_Var54 string
templ_7745c5c3_Var54, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, titleID)) templ_7745c5c3_Var54, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, titleID))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 235, Col: 56} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 238, Col: 56}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var54)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var54))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -1135,7 +1138,7 @@ func settingsLink(href, titleID, hintID string) templ.Component {
var templ_7745c5c3_Var55 string var templ_7745c5c3_Var55 string
templ_7745c5c3_Var55, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, hintID)) templ_7745c5c3_Var55, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, hintID))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 236, Col: 67} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/console.templ`, Line: 239, Col: 67}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var55)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var55))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
+17 -1
View File
@@ -21,17 +21,33 @@ templ confirmFields(me Me) {
templ accountDataSection(me Me) { templ accountDataSection(me Me) {
<section class="mt-12 max-w-xl"> <section class="mt-12 max-w-xl">
@accountDataBody(me)
</section>
}
// accountDataBody exports and deletes the account; also shown to accounts
// that are suspended or have not accepted the terms.
templ accountDataBody(me Me) {
@sectionHeading("gdpr.account_data") @sectionHeading("gdpr.account_data")
<p class="mb-4 text-sm text-muted">{ i18n.T(ctx, "gdpr.account_export_intro") }</p> <p class="mb-4 text-sm text-muted">{ i18n.T(ctx, "gdpr.account_export_intro") }</p>
@exportLinks("/api/v1/me/export") @exportLinks("/api/v1/me/export")
<h3 class="mb-2 mt-8 text-sm font-medium text-down">{ i18n.T(ctx, "gdpr.delete_account") }</h3> <h3 class="mb-2 mt-8 text-sm font-medium text-down">{ i18n.T(ctx, "gdpr.delete_account") }</h3>
<p class="mb-4 text-sm text-muted">{ i18n.T(ctx, "gdpr.delete_account_intro") }</p> <p class="mb-4 text-sm text-muted">{ i18n.T(ctx, "gdpr.delete_account_intro") }</p>
if len(me.DeletesOrgs) > 0 {
<div class="mb-4 border border-down p-3 text-sm">
<p class="mb-2 text-down">{ i18n.T(ctx, "gdpr.deletes_orgs") }</p>
<ul class="list-inside list-disc">
for _, o := range me.DeletesOrgs {
<li>{ o }</li>
}
</ul>
</div>
}
<form data-api="/me/delete" data-next="/login" data-confirm={ i18n.T(ctx, "gdpr.delete_account_confirm") }> <form data-api="/me/delete" data-next="/login" data-confirm={ i18n.T(ctx, "gdpr.delete_account_confirm") }>
@formError() @formError()
@confirmFields(me) @confirmFields(me)
<button type="submit" class="mt-2 w-full border border-down px-3 py-2 text-sm font-medium text-down hover:bg-down hover:text-paper disabled:opacity-50">{ i18n.T(ctx, "gdpr.delete_account") }</button> <button type="submit" class="mt-2 w-full border border-down px-3 py-2 text-sm font-medium text-down hover:bg-down hover:text-paper disabled:opacity-50">{ i18n.T(ctx, "gdpr.delete_account") }</button>
</form> </form>
</section>
} }
templ orgDataSection(me Me) { templ orgDataSection(me Me) {
+140 -63
View File
@@ -143,24 +143,55 @@ func accountDataSection(me Me) templ.Component {
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = accountDataBody(me).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</section>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
}
// accountDataBody exports and deletes the account; also shown to accounts
// that are suspended or have not accepted the terms.
func accountDataBody(me Me) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = sectionHeading("gdpr.account_data").Render(ctx, templ_7745c5c3_Buffer) templ_7745c5c3_Err = sectionHeading("gdpr.account_data").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "<p class=\"mb-4 text-sm text-muted\">") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "<p class=\"mb-4 text-sm text-muted\">")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
var templ_7745c5c3_Var8 string var templ_7745c5c3_Var9 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "gdpr.account_export_intro")) templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "gdpr.account_export_intro"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 25, Col: 79} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 32, Col: 79}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "</p>") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "</p>")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
@@ -168,46 +199,92 @@ func accountDataSection(me Me) templ.Component {
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "<h3 class=\"mb-2 mt-8 text-sm font-medium text-down\">") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "<h3 class=\"mb-2 mt-8 text-sm font-medium text-down\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "gdpr.delete_account"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 27, Col: 90}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "</h3><p class=\"mb-4 text-sm text-muted\">")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
var templ_7745c5c3_Var10 string var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "gdpr.delete_account_intro")) templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "gdpr.delete_account"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 28, Col: 79} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 34, Col: 90}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</p><form data-api=\"/me/delete\" data-next=\"/login\" data-confirm=\"") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</h3><p class=\"mb-4 text-sm text-muted\">")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
var templ_7745c5c3_Var11 string var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "gdpr.delete_account_confirm")).Resolve(ctx) templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "gdpr.delete_account_intro"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 29, Col: 106} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 35, Col: 79}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "\">") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "</p>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if len(me.DeletesOrgs) > 0 {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "<div class=\"mb-4 border border-down p-3 text-sm\"><p class=\"mb-2 text-down\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "gdpr.deletes_orgs"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 38, Col: 64}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "</p><ul class=\"list-inside list-disc\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, o := range me.DeletesOrgs {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "<li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(o)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 41, Col: 13}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "</li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</ul></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<form data-api=\"/me/delete\" data-next=\"/login\" data-confirm=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "gdpr.delete_account_confirm")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 46, Col: 106}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "\">")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
@@ -219,20 +296,20 @@ func accountDataSection(me Me) templ.Component {
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "<button type=\"submit\" class=\"mt-2 w-full border border-down px-3 py-2 text-sm font-medium text-down hover:bg-down hover:text-paper disabled:opacity-50\">") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<button type=\"submit\" class=\"mt-2 w-full border border-down px-3 py-2 text-sm font-medium text-down hover:bg-down hover:text-paper disabled:opacity-50\">")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
var templ_7745c5c3_Var12 string var templ_7745c5c3_Var15 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "gdpr.delete_account")) templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "gdpr.delete_account"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 32, Col: 191} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 49, Col: 191}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "</button></form></section>") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "</button></form>")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
@@ -257,7 +334,7 @@ func orgDataSection(me Me) templ.Component {
} }
ctx = templ.InitializeContext(ctx) ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx) ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "<section class=\"mt-12 max-w-xl\">") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "<section class=\"mt-12 max-w-xl\">")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
@@ -265,20 +342,20 @@ func orgDataSection(me Me) templ.Component {
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<p class=\"mb-4 text-sm text-muted\">") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<p class=\"mb-4 text-sm text-muted\">")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
var templ_7745c5c3_Var14 string var templ_7745c5c3_Var17 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "gdpr.org_export_intro")) templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "gdpr.org_export_intro"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 40, Col: 75} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 56, Col: 75}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</p>") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "</p>")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
@@ -287,46 +364,46 @@ func orgDataSection(me Me) templ.Component {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
if me.IsOwner { if me.IsOwner {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<h3 class=\"mb-2 mt-8 text-sm font-medium text-down\">") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<h3 class=\"mb-2 mt-8 text-sm font-medium text-down\">")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
var templ_7745c5c3_Var15 string var templ_7745c5c3_Var18 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "gdpr.delete_org")) templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "gdpr.delete_org"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 43, Col: 87} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 59, Col: 87}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "</h3><p class=\"mb-4 text-sm text-muted\">") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "</h3><p class=\"mb-4 text-sm text-muted\">")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
var templ_7745c5c3_Var16 string var templ_7745c5c3_Var19 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "gdpr.delete_org_intro")) templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "gdpr.delete_org_intro"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 44, Col: 76} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 60, Col: 76}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "</p><form data-api=\"/org/delete\" data-next=\"/\" data-confirm=\"") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "</p><form data-api=\"/org/delete\" data-next=\"/\" data-confirm=\"")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
var templ_7745c5c3_Var17 string var templ_7745c5c3_Var20 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "gdpr.delete_org_confirm")).Resolve(ctx) templ_7745c5c3_Var20, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "gdpr.delete_org_confirm")).Resolve(ctx)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 45, Col: 99} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 61, Col: 99}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var17) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var20)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "\">") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "\">")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
@@ -342,25 +419,25 @@ func orgDataSection(me Me) templ.Component {
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "<button type=\"submit\" class=\"mt-2 w-full border border-down px-3 py-2 text-sm font-medium text-down hover:bg-down hover:text-paper disabled:opacity-50\">") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "<button type=\"submit\" class=\"mt-2 w-full border border-down px-3 py-2 text-sm font-medium text-down hover:bg-down hover:text-paper disabled:opacity-50\">")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
var templ_7745c5c3_Var18 string var templ_7745c5c3_Var21 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "gdpr.delete_org")) templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "gdpr.delete_org"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 49, Col: 188} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/gdpr.templ`, Line: 65, Col: 188}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "</button></form>") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "</button></form>")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "</section>") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "</section>")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
+9 -2
View File
@@ -12,8 +12,15 @@ import (
"git.zb-server.de/ZB-Server/uptimesebi/internal/agentapi" "git.zb-server.de/ZB-Server/uptimesebi/internal/agentapi"
) )
// LegalKinds are the legal documents, in footer order. // LegalKinds are the platform's legal documents, in footer order.
var LegalKinds = []string{"imprint", "privacy"} var LegalKinds = []string{"imprint", "privacy", "terms"}
// OrgLegalKinds are the documents an organization sets for its status
// pages; their visitors accept no terms.
var OrgLegalKinds = []string{"imprint", "privacy"}
// ConsentKinds are the platform documents every account accepts.
var ConsentKinds = []string{"privacy", "terms"}
// LegalTitleID names the catalog message of a document kind. // LegalTitleID names the catalog message of a document kind.
func LegalTitleID(kind string) string { return "legal." + kind } func LegalTitleID(kind string) string { return "legal." + kind }
+7
View File
@@ -82,6 +82,9 @@ type LegalForm struct {
Kind string Kind string
URL string URL string
Markdown string Markdown string
// Consent marks documents every account accepts, which can be put
// before everyone again.
Consent bool
} }
// LegalSettingsPage edits legal documents. apiBase plus the kind is the // LegalSettingsPage edits legal documents. apiBase plus the kind is the
@@ -103,6 +106,10 @@ templ LegalSettingsPage(p Page, me Me, titleID, introID, apiBase, next string, d
@MarkdownEditor("markdown", d.Markdown, 14, 100000, MarkdownDocument) @MarkdownEditor("markdown", d.Markdown, 14, 100000, MarkdownDocument)
</div> </div>
<p class="mb-4 text-xs text-muted">{ i18n.T(ctx, "legal.hint") }</p> <p class="mb-4 text-xs text-muted">{ i18n.T(ctx, "legal.hint") }</p>
if d.Consent {
@checkbox(i18n.T(ctx, "legal.new_version"), "new_version", false)
<p class="-mt-2 mb-4 ml-6 text-xs text-muted">{ i18n.T(ctx, "legal.new_version_hint") }</p>
}
@submit(i18n.T(ctx, "common.save")) @submit(i18n.T(ctx, "common.save"))
</form> </form>
</section> </section>
+33 -7
View File
@@ -415,6 +415,9 @@ type LegalForm struct {
Kind string Kind string
URL string URL string
Markdown string Markdown string
// Consent marks documents every account accepts, which can be put
// before everyone again.
Consent bool
} }
// LegalSettingsPage edits legal documents. apiBase plus the kind is the // LegalSettingsPage edits legal documents. apiBase plus the kind is the
@@ -468,7 +471,7 @@ func LegalSettingsPage(p Page, me Me, titleID, introID, apiBase, next string, do
var templ_7745c5c3_Var22 string var templ_7745c5c3_Var22 string
templ_7745c5c3_Var22, templ_7745c5c3_Err = templruntime.NewAttributeExpression(apiBase + d.Kind).Resolve(ctx) templ_7745c5c3_Var22, templ_7745c5c3_Err = templruntime.NewAttributeExpression(apiBase + d.Kind).Resolve(ctx)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/legal.templ`, Line: 95, Col: 37} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/legal.templ`, Line: 98, Col: 37}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var22) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var22)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -481,7 +484,7 @@ func LegalSettingsPage(p Page, me Me, titleID, introID, apiBase, next string, do
var templ_7745c5c3_Var23 string var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templruntime.NewAttributeExpression(next).Resolve(ctx) templ_7745c5c3_Var23, templ_7745c5c3_Err = templruntime.NewAttributeExpression(next).Resolve(ctx)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/legal.templ`, Line: 95, Col: 74} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/legal.templ`, Line: 98, Col: 74}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var23) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var23)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -502,7 +505,7 @@ func LegalSettingsPage(p Page, me Me, titleID, introID, apiBase, next string, do
var templ_7745c5c3_Var24 string var templ_7745c5c3_Var24 string
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "legal.url")) templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "legal.url"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/legal.templ`, Line: 98, Col: 113} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/legal.templ`, Line: 101, Col: 113}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -515,7 +518,7 @@ func LegalSettingsPage(p Page, me Me, titleID, introID, apiBase, next string, do
var templ_7745c5c3_Var25 string var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templruntime.NewAttributeExpression(d.URL).Resolve(ctx) templ_7745c5c3_Var25, templ_7745c5c3_Err = templruntime.NewAttributeExpression(d.URL).Resolve(ctx)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/legal.templ`, Line: 99, Col: 48} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/legal.templ`, Line: 102, Col: 48}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var25) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var25)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -528,7 +531,7 @@ func LegalSettingsPage(p Page, me Me, titleID, introID, apiBase, next string, do
var templ_7745c5c3_Var26 string var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "legal.markdown")) templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "legal.markdown"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/legal.templ`, Line: 102, Col: 118} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/legal.templ`, Line: 105, Col: 118}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -549,7 +552,7 @@ func LegalSettingsPage(p Page, me Me, titleID, introID, apiBase, next string, do
var templ_7745c5c3_Var27 string var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "legal.hint")) templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "legal.hint"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/legal.templ`, Line: 105, Col: 67} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/legal.templ`, Line: 108, Col: 67}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -559,11 +562,34 @@ func LegalSettingsPage(p Page, me Me, titleID, introID, apiBase, next string, do
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
if d.Consent {
templ_7745c5c3_Err = checkbox(i18n.T(ctx, "legal.new_version"), "new_version", false).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "<p class=\"-mt-2 mb-4 ml-6 text-xs text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var28 string
templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "legal.new_version_hint"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/legal.templ`, Line: 111, Col: 91}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "</p>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = submit(i18n.T(ctx, "common.save")).Render(ctx, templ_7745c5c3_Buffer) templ_7745c5c3_Err = submit(i18n.T(ctx, "common.save")).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "</form></section>") templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "</form></section>")
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
+2
View File
@@ -438,6 +438,7 @@ type Invitation struct {
Email string Email string
SignedInAs string SignedInAs string
AccountExists bool AccountExists bool
Consent SignupConsent
} }
templ InvitationPage(p Page, v Invitation) { templ InvitationPage(p Page, v Invitation) {
@@ -463,6 +464,7 @@ templ InvitationPage(p Page, v Invitation) {
@formError() @formError()
@field(i18n.T(ctx, "auth.field.name"), "display_name", "text", "name", false) @field(i18n.T(ctx, "auth.field.name"), "display_name", "text", "name", false)
@field(i18n.T(ctx, "auth.field.new_password", "Min", auth.MinPasswordLength), "password", "password", "new-password", true) @field(i18n.T(ctx, "auth.field.new_password", "Min", auth.MinPasswordLength), "password", "password", "new-password", true)
@consentField(v.Consent)
@submit(i18n.T(ctx, "invite.create_account")) @submit(i18n.T(ctx, "invite.create_account"))
</form> </form>
} }
+16 -11
View File
@@ -1824,6 +1824,7 @@ type Invitation struct {
Email string Email string
SignedInAs string SignedInAs string
AccountExists bool AccountExists bool
Consent SignupConsent
} }
func InvitationPage(p Page, v Invitation) templ.Component { func InvitationPage(p Page, v Invitation) templ.Component {
@@ -1863,7 +1864,7 @@ func InvitationPage(p Page, v Invitation) templ.Component {
var templ_7745c5c3_Var84 string var templ_7745c5c3_Var84 string
templ_7745c5c3_Var84, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "error.invitation_invalid")) templ_7745c5c3_Var84, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "error.invitation_invalid"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 446, Col: 63} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 447, Col: 63}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var84)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var84))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -1881,7 +1882,7 @@ func InvitationPage(p Page, v Invitation) templ.Component {
var templ_7745c5c3_Var85 string var templ_7745c5c3_Var85 string
templ_7745c5c3_Var85, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "invite.summary", "Org", v.OrgName, "Role", v.RoleName)) templ_7745c5c3_Var85, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "invite.summary", "Org", v.OrgName, "Role", v.RoleName))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 448, Col: 96} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 449, Col: 96}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var85)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var85))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -1894,7 +1895,7 @@ func InvitationPage(p Page, v Invitation) templ.Component {
var templ_7745c5c3_Var86 string var templ_7745c5c3_Var86 string
templ_7745c5c3_Var86, templ_7745c5c3_Err = templ.JoinStringErrs(v.Email) templ_7745c5c3_Var86, templ_7745c5c3_Err = templ.JoinStringErrs(v.Email)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 449, Col: 46} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 450, Col: 46}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var86)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var86))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -1913,7 +1914,7 @@ func InvitationPage(p Page, v Invitation) templ.Component {
var templ_7745c5c3_Var87 string var templ_7745c5c3_Var87 string
templ_7745c5c3_Var87, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/invitations/" + v.Token + "/accept").Resolve(ctx) templ_7745c5c3_Var87, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/invitations/" + v.Token + "/accept").Resolve(ctx)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 452, Col: 59} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 453, Col: 59}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var87) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var87)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -1943,7 +1944,7 @@ func InvitationPage(p Page, v Invitation) templ.Component {
var templ_7745c5c3_Var88 string var templ_7745c5c3_Var88 string
templ_7745c5c3_Var88, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "error.invitation_email_mismatch")) templ_7745c5c3_Var88, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "error.invitation_email_mismatch"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 457, Col: 82} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 458, Col: 82}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var88)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var88))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -1956,7 +1957,7 @@ func InvitationPage(p Page, v Invitation) templ.Component {
var templ_7745c5c3_Var89 string var templ_7745c5c3_Var89 string
templ_7745c5c3_Var89, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.nav.logout")) templ_7745c5c3_Var89, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "console.nav.logout"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 458, Col: 110} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 459, Col: 110}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var89)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var89))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -1974,7 +1975,7 @@ func InvitationPage(p Page, v Invitation) templ.Component {
var templ_7745c5c3_Var90 string var templ_7745c5c3_Var90 string
templ_7745c5c3_Var90, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL("/login?next=/invite/" + v.Token)).ResolveURL(ctx) templ_7745c5c3_Var90, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL("/login?next=/invite/" + v.Token)).ResolveURL(ctx)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 460, Col: 62} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 461, Col: 62}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var90) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var90)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -1987,7 +1988,7 @@ func InvitationPage(p Page, v Invitation) templ.Component {
var templ_7745c5c3_Var91 string var templ_7745c5c3_Var91 string
templ_7745c5c3_Var91, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "invite.sign_in")) templ_7745c5c3_Var91, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "invite.sign_in"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 460, Col: 153} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 461, Col: 153}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var91)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var91))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -2005,7 +2006,7 @@ func InvitationPage(p Page, v Invitation) templ.Component {
var templ_7745c5c3_Var92 string var templ_7745c5c3_Var92 string
templ_7745c5c3_Var92, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/invitations/" + v.Token + "/signup").Resolve(ctx) templ_7745c5c3_Var92, templ_7745c5c3_Err = templruntime.NewAttributeExpression("/invitations/" + v.Token + "/signup").Resolve(ctx)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 462, Col: 59} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 463, Col: 59}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var92) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var92)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -2027,6 +2028,10 @@ func InvitationPage(p Page, v Invitation) templ.Component {
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
} }
templ_7745c5c3_Err = consentField(v.Consent).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = submit(i18n.T(ctx, "invite.create_account")).Render(ctx, templ_7745c5c3_Buffer) templ_7745c5c3_Err = submit(i18n.T(ctx, "invite.create_account")).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err return templ_7745c5c3_Err
@@ -2079,7 +2084,7 @@ func tokenUsage() templ.Component {
var templ_7745c5c3_Var94 string var templ_7745c5c3_Var94 string
templ_7745c5c3_Var94, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "tokens.usage")) templ_7745c5c3_Var94, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "tokens.usage"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 483, Col: 31} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 485, Col: 31}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var94)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var94))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@@ -2092,7 +2097,7 @@ func tokenUsage() templ.Component {
var templ_7745c5c3_Var95 string var templ_7745c5c3_Var95 string
templ_7745c5c3_Var95, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "apidocs.title")) templ_7745c5c3_Var95, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "apidocs.title"))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 486, Col: 98} return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/org.templ`, Line: 488, Col: 98}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var95)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var95))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {