Files
3m-ui/backend/internal/database/models/user.go
T
Z User 4778c43c79 feat: online ops parity — HWID devices UI, first-use expiry, external subs, TOTP, web_path
- Users: start_on_first_use + expire_days_after_first; TouchFirstUse on sub/traffic
- External subscription URLs merged into Clash/Mihomo client YAML
- HWID device list/kick/clear wired in Users (API already present)
- Admin TOTP 2FA (setup/enable/disable + login second step)
- Optional server.web_path panel prefix (config.yaml)
- subscription-userinfo already present; Traffic page shows live connections
feat: online ops parity — HWID devices UI, first-use expiry, external subs, TOTP, web_path
- Users: start_on_first_use + expire_days_after_first; TouchFirstUse on sub/traffic
- External subscription URLs merged into Clash/Mihomo client YAML
- HWID device list/kick/clear wired in Users (API already present)
- Admin TOTP 2FA (setup/enable/disable + login second step)
- Optional server.web_path panel prefix (config.yaml)
- subscription-userinfo already present; Traffic page shows live connections
feat: online ops parity — HWID devices UI, first-use expiry, external subs, TOTP, web_path
- Users: start_on_first_use + expire_days_after_first; TouchFirstUse on sub/traffic
- External subscription URLs merged into Clash/Mihomo client YAML
- HWID device list/kick/clear wired in Users (API already present)
- Admin TOTP 2FA (setup/enable/disable + login second step)
- Optional server.web_path panel prefix (config.yaml)
- subscription-userinfo already present; Traffic page shows live connections
feat: online ops parity — HWID devices UI, first-use expiry, external subs, TOTP, web_path
- Users: start_on_first_use + expire_days_after_first; TouchFirstUse on sub/traffic
- External subscription URLs merged into Clash/Mihomo client YAML
- HWID device list/kick/clear wired in Users (API already present)
- Admin TOTP 2FA (setup/enable/disable + login second step)
- Optional server.web_path panel prefix (config.yaml)
- subscription-userinfo already present; Traffic page shows live connections
feat: online ops parity — HWID devices UI, first-use expiry, external subs, TOTP, web_path
- Users: start_on_first_use + expire_days_after_first; TouchFirstUse on sub/traffic
- External subscription URLs merged into Clash/Mihomo client YAML
- HWID device list/kick/clear wired in Users (API already present)
- Admin TOTP 2FA (setup/enable/disable + login second step)
- Optional server.web_path panel prefix (config.yaml)
- subscription-userinfo already present; Traffic page shows live connections
feat: online ops parity — HWID devices UI, first-use expiry, external subs, TOTP, web_path
- Users: start_on_first_use + expire_days_after_first; TouchFirstUse on sub/traffic
- External subscription URLs merged into Clash/Mihomo client YAML
- HWID device list/kick/clear wired in Users (API already present)
- Admin TOTP 2FA (setup/enable/disable + login second step)
- Optional server.web_path panel prefix (config.yaml)
- subscription-userinfo already present; Traffic page shows live connections
feat: online ops parity — HWID devices UI, first-use expiry, external subs, TOTP, web_path
- Users: start_on_first_use + expire_days_after_first; TouchFirstUse on sub/traffic
- External subscription URLs merged into Clash/Mihomo client YAML
- HWID device list/kick/clear wired in Users (API already present)
- Admin TOTP 2FA (setup/enable/disable + login second step)
- Optional server.web_path panel prefix (config.yaml)
- subscription-userinfo already present; Traffic page shows live connections
feat: online ops parity — HWID devices UI, first-use expiry, external subs, TOTP, web_path
- Users: start_on_first_use + expire_days_after_first; TouchFirstUse on sub/traffic
- External subscription URLs merged into Clash/Mihomo client YAML
- HWID device list/kick/clear wired in Users (API already present)
- Admin TOTP 2FA (setup/enable/disable + login second step)
- Optional server.web_path panel prefix (config.yaml)
- subscription-userinfo already present; Traffic page shows live connections
feat: online ops parity — HWID devices UI, first-use expiry, external subs, TOTP, web_path
- Users: start_on_first_use + expire_days_after_first; TouchFirstUse on sub/traffic
- External subscription URLs merged into Clash/Mihomo client YAML
- HWID device list/kick/clear wired in Users (API already present)
- Admin TOTP 2FA (setup/enable/disable + login second step)
- Optional server.web_path panel prefix (config.yaml)
- subscription-userinfo already present; Traffic page shows live connections
feat: online ops parity — HWID devices UI, first-use expiry, external subs, TOTP, web_path
- Users: start_on_first_use + expire_days_after_first; TouchFirstUse on sub/traffic
- External subscription URLs merged into Clash/Mihomo client YAML
- HWID device list/kick/clear wired in Users (API already present)
- Admin TOTP 2FA (setup/enable/disable + login second step)
- Optional server.web_path panel prefix (config.yaml)
- subscription-userinfo already present; Traffic page shows live connections
feat: online ops parity — HWID devices UI, first-use expiry, external subs, TOTP, web_path
- Users: start_on_first_use + expire_days_after_first; TouchFirstUse on sub/traffic
- External subscription URLs merged into Clash/Mihomo client YAML
- HWID device list/kick/clear wired in Users (API already present)
- Admin TOTP 2FA (setup/enable/disable + login second step)
- Optional server.web_path panel prefix (config.yaml)
- subscription-userinfo already present; Traffic page shows live connections
feat: online ops parity — HWID devices UI, first-use expiry, external subs, TOTP, web_path
- Users: start_on_first_use + expire_days_after_first; TouchFirstUse on sub/traffic
- External subscription URLs merged into Clash/Mihomo client YAML
- HWID device list/kick/clear wired in Users (API already present)
- Admin TOTP 2FA (setup/enable/disable + login second step)
- Optional server.web_path panel prefix (config.yaml)
- subscription-userinfo already present; Traffic page shows live connections
2026-09-12 15:31:24 +00:00

15 lines
657 B
Go

package models
type User struct {
BaseModel
Username string `gorm:"uniqueIndex;not null" json:"username"`
PasswordHash string `gorm:"not null" json:"-"`
Role string `gorm:"not null" json:"role"`
MustChangePassword bool `gorm:"not null;default:false" json:"must_change_password"`
SessionVersion uint `gorm:"not null;default:1" json:"-"`
// TOTPSecret is base32-encoded shared secret; empty means 2FA not configured.
TOTPSecret string `gorm:"size:64;default:''" json:"-"`
// TOTPEnabled requires a valid TOTP code after password on login.
TOTPEnabled bool `gorm:"not null;default:false" json:"totp_enabled"`
}