store: extend User struct with Email, DisabledAt, MustChangePassword

This commit is contained in:
2026-05-05 09:02:03 +01:00
parent a7e53e0a64
commit bd08d8ca14
+14
View File
@@ -13,6 +13,9 @@ type User struct {
Username string
PasswordHash string
Role Role
Email *string // optional; nil = not set
DisabledAt *time.Time // nil = enabled
MustChangePassword bool
CreatedAt time.Time
LastLoginAt *time.Time
}
@@ -219,3 +222,14 @@ type AuditEntry struct {
TS time.Time
Payload json.RawMessage
}
// SetupToken mirrors the user_setup_tokens table. The raw token
// itself is never stored; the field shown here is the sha256 hex
// digest of the raw token, which is what callers compare against.
type SetupToken struct {
UserID string
TokenHash string
ExpiresAt time.Time
CreatedAt time.Time
CreatedBy *string // admin user id; nil only after CASCADE SET NULL
}