package model import ( "time" ) // Credential represents an alternative authentication credential for a user. // The primary password is stored on the User model; additional credentials // (app passkeys, WebAuthn, OAuth) are stored here with a type discriminator. type Credential struct { ID string `gorm:"primaryKey;type:varchar(36)"` UserID string `gorm:"index;type:varchar(36);not null"` Type string `gorm:"index;type:varchar(32);not null"` Label string `gorm:"type:varchar(128)"` SecretHash string `gorm:"uniqueIndex;type:varchar(255);not null" json:"-"` LastUsedAt *time.Time CreatedAt time.Time }