package models import ( "time" "git.golem15.com/golem15/summercms/modules/lagoon" ) // OAuthIdentity is one linked social-login provider for a user. type OAuthIdentity struct { ID uint `gorm:"column:id;primaryKey"` UserID uint `gorm:"column:user_id"` Provider string `gorm:"column:provider"` ProviderID string `gorm:"column:provider_id"` AccessToken lagoon.Encrypted `gorm:"column:access_token" json:"-"` RefreshToken lagoon.Encrypted `gorm:"column:refresh_token" json:"-"` TokenExpiresAt *time.Time `gorm:"column:token_expires_at"` ProfileData lagoon.Jsonable[map[string]any] `gorm:"column:profile_data" json:"-"` LinkedAt *time.Time `gorm:"column:linked_at"` CreatedAt time.Time `gorm:"column:created_at"` UpdatedAt time.Time `gorm:"column:updated_at"` } func (OAuthIdentity) TableName() string { return "golem15_user_oauth_identities" } func (OAuthIdentity) Fillable() []string { return []string{} } func (OAuthIdentity) Hidden() []string { return []string{"access_token", "refresh_token", "profile_data"} } func init() { Register(OAuthIdentity{}) }