feat(auth): invite links for several people, invite by email, registration with approval or email domains
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 2m20s

- Invites: link /?invite=CODE, copy link, send by email, max uses with counter
- Registration modes closed | approval | domain | domain+approval | open, waiting list with approve/reject
- REGISTRATION_MODE / REGISTRATION_DOMAINS lock the admin setting; ALLOW_REGISTRATION=true is honoured

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
sandrodachandClaude Opus 5.5 committed 2026-10-31 13:43:54 +01:00
1 parent db5c5cde9b
commit af77b9e809
24 files changed
+1077 -142

No files matched your search

+19 -7
View File
@@ -135,6 +135,8 @@ type User struct {
NotifyBeforeMinutes int `json:"notifyBeforeMinutes"`
OrganizationID string `json:"organizationId,omitempty"`
CreatedAt string `json:"createdAt"`
// Registered while registration needs approval and not approved yet (admin user list only)
PendingApproval bool `json:"pendingApproval,omitempty"`
// Only filled for the user's own profile (GET /auth/me, PATCH /auth/settings)
NotificationSettings *NotificationSettings `json:"notificationSettings,omitempty"`
}
@@ -216,7 +218,10 @@ type UserInvite struct {
CreatedBy string `json:"createdBy"`
ExpiresAt string `json:"expiresAt"`
UsedBy string `json:"usedBy,omitempty"`
CreatedAt string `json:"createdAt"`
// A link for several people: how often it may be used and how often it was
MaxUses int `json:"maxUses"`
UseCount int `json:"useCount"`
CreatedAt string `json:"createdAt"`
}
type ThoughtStatus string
@@ -350,12 +355,19 @@ type TeamMember struct {
}
type SystemSettings struct {
SharingMode string `json:"sharingMode"` // private | organizations | open
AllowRegistration bool `json:"allowRegistration"`
InstanceName string `json:"instanceName"`
SMTPHost string `json:"smtpHost"`
SMTPPort string `json:"smtpPort"`
SMTPUser string `json:"smtpUser"`
SharingMode string `json:"sharingMode"` // private | organizations | open
// AllowRegistration mirrors RegistrationMode == "open" (older clients and the setup wizard)
AllowRegistration bool `json:"allowRegistration"`
// Who may register without an invite: closed | approval | domain | domain+approval | open
RegistrationMode string `json:"registrationMode"`
// E-mail domains for the domain modes, comma separated ("firma.de, familie.de")
RegistrationDomains string `json:"registrationDomains"`
// Set by REGISTRATION_MODE / REGISTRATION_DOMAINS (or ALLOW_REGISTRATION=true): not editable here
RegistrationConfiguredViaEnv bool `json:"registrationConfiguredViaEnv,omitempty"`
InstanceName string `json:"instanceName"`
SMTPHost string `json:"smtpHost"`
SMTPPort string `json:"smtpPort"`
SMTPUser string `json:"smtpUser"`
// SMTPPass is never sent to the browser (FLAW-34): reads leave it empty and set SMTPPassSet;
// writing it empty keeps the stored password
SMTPPass string `json:"smtpPass"`