mirror of
https://github.com/gl-inet/glkvm-cloud.git
synced 2026-09-21 10:03:28 +00:00
f49525ee9c
- Personal Center page with profile editing and last-login info - TOTP-based two-factor authentication with QR code setup - 30-day trusted-device cookie to skip 2FA on familiar browsers - Friendly browser/OS labels for the trusted device list Signed-off-by: GL.iNet-Yongping.Xie <yongping.xie@gl-inet.com>
30 lines
676 B
Go
Executable File
30 lines
676 B
Go
Executable File
package user
|
|
|
|
import (
|
|
"rttys/internal/domain/identity"
|
|
)
|
|
|
|
type Status string
|
|
|
|
const (
|
|
StatusActive Status = "active"
|
|
StatusDisabled Status = "disabled"
|
|
)
|
|
|
|
type User struct {
|
|
ID int64
|
|
Username string
|
|
Email string
|
|
Description string
|
|
PasswordHash string
|
|
Role identity.Role
|
|
Status Status
|
|
IsSystem bool
|
|
AuthProvider string // "local", "oidc", "ldap"
|
|
ExternalSub string // OIDC sub claim / LDAP user DN
|
|
LastLoginAt *int64 // unix seconds, nil if never
|
|
TotpSecret string // base32 secret; "" when 2FA not enabled
|
|
TotpEnabled bool
|
|
CreatedAt int64 // unix seconds
|
|
}
|