Store client id/secret and allowed GitHub usernames in settings. OAuth start/callback issues the same session JWT as password login; first allowed login can bind to matching or sole admin account. Login page shows Continue with GitHub when enabled. feat(auth): optional GitHub OAuth for panel login Store client id/secret and allowed GitHub usernames in settings. OAuth start/callback issues the same session JWT as password login; first allowed login can bind to matching or sole admin account. Login page shows Continue with GitHub when enabled. feat(auth): optional GitHub OAuth for panel login Store client id/secret and allowed GitHub usernames in settings. OAuth start/callback issues the same session JWT as password login; first allowed login can bind to matching or sole admin account. Login page shows Continue with GitHub when enabled. feat(auth): optional GitHub OAuth for panel login Store client id/secret and allowed GitHub usernames in settings. OAuth start/callback issues the same session JWT as password login; first allowed login can bind to matching or sole admin account. Login page shows Continue with GitHub when enabled. feat(auth): optional GitHub OAuth for panel login Store client id/secret and allowed GitHub usernames in settings. OAuth start/callback issues the same session JWT as password login; first allowed login can bind to matching or sole admin account. Login page shows Continue with GitHub when enabled. feat(auth): optional GitHub OAuth for panel login Store client id/secret and allowed GitHub usernames in settings. OAuth start/callback issues the same session JWT as password login; first allowed login can bind to matching or sole admin account. Login page shows Continue with GitHub when enabled. feat(auth): optional GitHub OAuth for panel login Store client id/secret and allowed GitHub usernames in settings. OAuth start/callback issues the same session JWT as password login; first allowed login can bind to matching or sole admin account. Login page shows Continue with GitHub when enabled. feat(auth): optional GitHub OAuth for panel login Store client id/secret and allowed GitHub usernames in settings. OAuth start/callback issues the same session JWT as password login; first allowed login can bind to matching or sole admin account. Login page shows Continue with GitHub when enabled. feat(auth): optional GitHub OAuth for panel login Store client id/secret and allowed GitHub usernames in settings. OAuth start/callback issues the same session JWT as password login; first allowed login can bind to matching or sole admin account. Login page shows Continue with GitHub when enabled. feat(auth): optional GitHub OAuth for panel login Store client id/secret and allowed GitHub usernames in settings. OAuth start/callback issues the same session JWT as password login; first allowed login can bind to matching or sole admin account. Login page shows Continue with GitHub when enabled. feat(auth): optional GitHub OAuth for panel login Store client id/secret and allowed GitHub usernames in settings. OAuth start/callback issues the same session JWT as password login; first allowed login can bind to matching or sole admin account. Login page shows Continue with GitHub when enabled. feat(auth): optional GitHub OAuth for panel login Store client id/secret and allowed GitHub usernames in settings. OAuth start/callback issues the same session JWT as password login; first allowed login can bind to matching or sole admin account. Login page shows Continue with GitHub when enabled.
19 lines
957 B
Go
19 lines
957 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"`
|
|
// GithubID is the numeric GitHub user id as string; empty = not linked.
|
|
GithubID string `gorm:"size:32;index" json:"github_id,omitempty"`
|
|
// GithubLogin is the GitHub username at last successful OAuth (display/audit).
|
|
GithubLogin string `gorm:"size:64;default:''" json:"github_login,omitempty"`
|
|
}
|