store: extend User struct with Email, DisabledAt, MustChangePassword
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user