diff --git a/cmd/server/main.go b/cmd/server/main.go index 027f2b8..e7c4eec 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -128,6 +128,20 @@ func main() { inviteSvc := services.NewInviteService(pool, mailSvc, handlers.AllowedEmailDomains, baseURL) reminderSvc := services.NewReminderService(pool, mailSvc, users, baseURL) + // t-paliad-223 Slice B (#49) — Supabase Admin API client for the + // new "Konto direkt anlegen" path on /admin/team. The key is + // optional: when unset the client still wires (so dependents + // don't panic) but every call short-circuits with + // ErrSupabaseAdminUnavailable so the rest of the server stays + // runnable. + supabaseAdminClient := services.LoadSupabaseAdminClient() + if supabaseAdminClient.Enabled() { + log.Println("supabase admin API configured — /admin/team Add-User path active") + } else { + log.Println("SUPABASE_SERVICE_ROLE_KEY not set — /admin/team Add-User path will return 503") + } + users.SetAddUserDeps(supabaseAdminClient, mailSvc, baseURL) + // Wire EmailTemplateService onto the MailService so DB-backed admin // edits propagate without a process restart. The constructor is split // from MailService creation because the DB pool isn't available yet diff --git a/frontend/src/admin-team.tsx b/frontend/src/admin-team.tsx index 37fa286..8b0c253 100644 --- a/frontend/src/admin-team.tsx +++ b/frontend/src/admin-team.tsx @@ -33,6 +33,9 @@ export function renderAdminTeam(): string {

+ @@ -132,6 +135,67 @@ export function renderAdminTeam(): string {
+ {/* t-paliad-223 Slice B (#49) — "Konto direkt anlegen" modal. + Creates BOTH the auth.users row (via Supabase Admin API) and + the paliad.users row in one click. New user is visible in + dropdowns immediately. */} +